Are thread IDs unique per process or per computer? Are thread IDs unique per process or per computer? multithreading multithreading

Are thread IDs unique per process or per computer?


Yes, thread ID's and Process ID's on Windows are allocated from the same pool, so they will be unique. Once the thread or process ends however, the ID may be re-used by another thread or process.


A thread is represented by a kernel object e.g. on Windows platform. Hence it's id will be unique across all processes across all logon sessions. However thread ids can be recycled after the thread kernel object is closed.

GetCurrentThreadId also clearly says about the unique id while running.