Title: Message

Because you may need to know the thread's OS id.

And because while it may change threads under you, I'm not aware of a host that actually does this.

 

From: Marc Lewandowski [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 09, 2006 7:12 PM
To: 'Log4NET User'
Subject: Why ThreadId and not Hash Code?

 

From the .NET SDK:

 

GetHashCode provides identification for managed threads. For the lifetime of your thread, it will not collide with the value from any other thread, regardless of the application domain from which you obtain the value.

Note   An operating-system ThreadId has no fixed relationship to a managed thread, because an unmanaged host can control the relationship between managed and unmanaged threads. Specifically, a sophisticated host can use the CLR Hosting API to schedule many managed threads against the same operating system thread, or to move a managed thread between different operating system threads.

So, why does log4net use the OS thread id?  Is this behavior configurable?

 

-Marc

 


Marc A. Lewandowski
Director of IT
TeleBill, Inc.

 

Reply via email to