Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-148

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.2.9, 1.2.10
    • 1.2.12
    • Core
    • None
    • .Net Framework

    Description

      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

      Attachments

        Activity

          People

            nachbarslumpi Dominik Psenner
            htorresrocca Hernando Torres-Rocca
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: