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 "Dominik Psenner (JIRA)" <ji...@apache.org> on 2013/06/05 17:04:21 UTC

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

     [ https://issues.apache.org/jira/browse/LOG4NET-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominik Psenner resolved LOG4NET-148.
-------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.2 Maintenance Release)
                   1.2.12

Applied patch and fixed build errors as of revision: 1489904
                
> 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.9, 1.2.10
>         Environment: .Net Framework
>            Reporter: Hernando Torres-Rocca
>            Assignee: Dominik Psenner
>            Priority: Critical
>             Fix For: 1.2.12
>
>         Attachments: ThreadContextProperties.cs
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira