on-internet
← Community

Do Sleep(0) and SwitchToThread behave the same? [closed]

Stack Overflow ·

[Edited] I'm having trouble understanding the difference between the Sleep(0) and SwitchToThread function in WinAPI. And Q1. I want to clarify them whether they behave the same, or if different, how they differ and when to use which. There was a related question, but it was too old and not verified. But the answer is not what I am looking for. According to learn.microsoft.com, SwitchToThread: causes the calling thread to yield execution to another thread that is ready to run on the CURRENT processor Reference SwitchToThread Sleep(0): A value of zero causes the thread to relinquish the remainde

Comments

Sign in or sign up to comment and upvote.

No comments yet.