Windows - thread id change when a context switch happens

628 Views Asked by At

Do Thread Id's change when a context switch (due to any reason) happens?

2

There are 2 best solutions below

0
On BEST ANSWER

From http://msdn.microsoft.com/en-us/library/ms683183(v=vs.85).aspx:

GetCurrentThreadId()

Until the thread terminates, the thread identifier uniquely identifies the thread throughout the system.

0
On

The thread ID of a thread cannot change. A thread's ID remains constant through the thread's lifetime.