How unique is ManagedThreadID?

后端 未结 2 602
生来不讨喜
生来不讨喜 2021-02-18 15:45

For ManagedThreadID, MSDN says:

Gets a unique identifier for the current managed thread.

In what context does \"unique\" apply?

相关标签:
2条回答
  • 2021-02-18 15:53

    Since threads from the ThreadPool also have to honour this property, and there is one ThreadPool per process (as stated in this MSDN article), I would think that the ManagedThreadId is most likely unique per process.

    0 讨论(0)
  • 2021-02-18 15:59

    Thread ID is unique per process during a thread's lifecycle. After the thread terminates, its number can be reused.

    0 讨论(0)
提交回复
热议问题