Does Sleep(0) lets the core to execute other core's thread that is ready to run?
14:59 10 Nov 2026

I'm having confusion with understanding Sleep(0) function in WinAPI. And I want to clarify it comparing with SwitchToThread function.

There was a related question but it was too old and not verified. Also, my question is not about difference between them, so it is different question.

As far as I have understood, there is a thread queue per core (assuming from the statement "thread that is ready to run on the current processor") and

SwitchToThread : "Causes the calling thread to yield execution to another thread that is ready to run on the CURRENT processor"

SwitchToThread

Sleep(0) : "A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of EQUAL priority that is ready to run."

Sleep(0)

As far as Sleep(0) is not limited on the current processor, it sounds Sleep(0) lets the core to execute the thread, of current core's thread queue + of other core's thread queue (that is, "any", but of equal priority), that is ready to run.

If anyone clarifies it, it will be truly appreciated.

multithreading winapi sleep cpu-cores