SwitchToThread vs Sleep(1)
I'm wondering what's the actual difference between calling Thread.Sleep(1) and calling SwitchToThread() (if we ignore that it's currently not exposed by the BCL). Joe Duffy mentions in his post that: "The kernel32!SwitchToThread API doesn't exhibit the problems that Sleep(0) and Sleep(1) do." (regarding the scheduler's behavior) Why won't Sleep behave exactly like SwitchToThread? Why this differentiation exist, and for what is it good for? (if at all..)
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.