Search code examples
windowsmultithreadingnativemulticorecontext-switch

Windows - thread id change when a context switch happens


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


Solution

  • 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.