你好,
执行上下文包涵了安全设置、宿主设置和逻辑调用上下文数据,CLR默认是把初始线程的执行上下文数据向辅助线程流动, 一般情况下,我们不需要管他。
>>如果我要阻止上下文的流动,该如何判断子线程是否会受到影响?
如果这样做的话,你的方法会是不安全的,因为安全设置都在这个执行上下文里面。
下面有个英文博客,详细描述了执行上下文,你可以参考一下:
https://blogs.msdn.microsoft.com/pfxteam/2012/06/15/executioncontext-vs-synchronizationcontext/
Best regards,
Zhanglong
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.