开发者

How unique is ManagedThreadID?

开发者 https://www.devze.com 2022-12-19 18:15 出处:网络
For ManagedThreadID, MSDN says: Gets a unique i开发者_如何学JAVAdentifier for the current managed thread.

For ManagedThreadID, MSDN says:

Gets a unique i开发者_如何学JAVAdentifier for the current managed thread.

In what context does "unique" apply?

Is this unique per process?

Per application domain?

Per machine?

Per .NET runtime? (if I have both MS.NET and Mono running)


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


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

精彩评论

暂无评论...
验证码 换一张
取 消