We have recently had some nasty problems w/ log4j synchronization. This was laid out in a recent post to this list; "threading issue with log4j" on Nov 23, 2005
It is a problem w/ the 1.2.X code base, which synchronizes within the callAppenders method of Category. This is a fundamental class of log4j, so this issue should be a significant concern to all users. For us, the problem was only fully realized when we added a SysLogAppender, which is slow enough to highlight the problem. The good news is that this code is corrected in the 1.3 codebase. The bad news is that the 1.3 codebase is still in alpha. Cheers, -- Chris On 12/2/05, Endre Stølsvik <[EMAIL PROTECTED] > wrote: > > On Fri, 2 Dec 2005, Curt Arnold wrote: > > | > | On Dec 2, 2005, at 12:19 AM, Trenton D. Adams wrote: > | > > | > Could the optimizer move the "instanceIndicator = 1" up one line? > Perhaps by > | > analyzing exactly what's happening it could, because it knows, or > *thinks* > | > it won't affect anything. > | > | > | Sorry way off topic now, we aren't the best people to give > synchronization > | tutorials, and the rest of the log4j users subscribers aren't likely > | interested in one. > > log4j should -definately- be -extremely into- synchronization issues. I > myself log -a whole lot-, and if I'm hit by synchs on every log even if > the debug or trace is turned off, this will eat a -ton- of time. Remember > that synching becomes REALLY BIG if you're running on a NUMA-machine or > even on multi-cpu/core machines. > > But the double-checked locked idiom is _truly_ broken, and it cannot be > repaired. The page mentioned gives every reason for it. Lazy init in java > is _impossible_, _except_ for static initializers. > > The concurrent.jar is a nice piece of work, and was included in java 1.5 > as the JSR 166, java.util.concurrent. But concurrent.jar (as it is named, > not concurrency.jar !) is just as good. > > (There is also an backport of the actual JSR 166 code, but this is > targetted to 1.4) > > Regards, > Endre. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >