At 22:29 17.07.2001 -0400, Dan Milstein wrote:
>I just downloaded the source for log4j and was reading through the code for
>NDC's.  Unless I misunderstand it, there's a basic error in line 228:
>
>      // Avoid calling clean-up too often.
>      if(++pushCounter >= REAP_THRESHOLD) {
>        return; // We release the lock ASAP.
>      } else {
>        pushCounter = 0; // OK let's do some work.
>      }
>
>That first line should be:
>
>      if(++pushCounter <= REAP_THRESHOLD)


>As the code now stands, it will do the "lazy remove" *every* time remove is
>called (with the associated expensive creation of an Enumeration, locking of
>the Hashtable, etc).  It will function correctly, but it will suffer in
>terms of performance.

You are absolutely correct. We'll fix this for log4j 1.2. Thanks, Ceki


--
Ceki Gülcü - http://qos.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to