【发布时间】:2013-11-05 12:41:07
【问题描述】:
我正在使用 Stephen Toub 的 StaTaskScheduler,原因描述为 here。
据我了解,任务调度是Task Scheduler的职责,而awaitcontinuation是Synchronization Context的职责(如有错误请指正)。
现在我想在由StaTaskScheduler 创建的STA 线程之一上运行的任务代码中使用await。我是否应该安装自定义同步上下文,以确保代码在await 之后的相同 STA 线程上继续执行?
【问题讨论】:
标签: c# .net multithreading task-parallel-library async-await