You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Hernando Torres-Rocca (JIRA)" <ji...@apache.org> on 2008/04/22 17:27:27 UTC

[jira] Created: (LOG4NET-148) ThreadContext uses LocalDataStore to store ThreadSpecific data instead should be using [ThreadStatic] variables.

ThreadContext uses LocalDataStore to store ThreadSpecific data instead should be using  [ThreadStatic] variables.
-----------------------------------------------------------------------------------------------------------------

                 Key: LOG4NET-148
                 URL: https://issues.apache.org/jira/browse/LOG4NET-148
             Project: Log4net
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.2.10, 1.2.9
         Environment: .Net Framework
            Reporter: Hernando Torres-Rocca
            Priority: Critical


According to this article (http://blogs.msdn.com/junfeng/archive/2005/12/31/508423.aspx) and production issues encountered: using LocalDataStore is not a scalable approach for any web server that gets a significant amount of traffic.

The ThreadContext object should be modified to use [ThreadStatic] variables.

>From the article:
The Whidbey RTM implementation of Thread.GetData/Thread.SetData has several scalability issues caused by global locks being taken. The appdomain-global lock taken in LocalDataStore.SetData is one of them. There is another global lock taken in ThreadNative::GetDomainLocalStore that is even worse since it is process-global.

The best workaround is to use [ThreadStatic] variables instead of Thread.GetData/Thread.SetData

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.