Thread.Sleep(0) : What is the normal behavior?

后端 未结 5 1390
渐次进展
渐次进展 2020-12-05 10:13

To my understanding a Thread.Sleep(0) force a context switch on the OS.

I wanted to check what was the maximum amount of time that could pass in an application befor

5条回答
  •  攒了一身酷
    2020-12-05 10:54

    I suspect that you noticed impact due to your other program was also only CPU bound. Therefore the is also a third program running your not taking into account the OS scheduler.

    The non-impacted program is getting stopped by the OS to allow your program to run, and there is context hit for swapping out the process and then loading yours then unloading it again.

提交回复
热议问题