Are thread IDs unique per process or per computer?

c++, multithreading, thread-safety, winapi

Solution

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.

Problem

Say, if I have a thread ID, can I be assured that it will be unique (for as long the thread is running) per process or throughout the OS (among all logged in users)?

Original source