[slf4j-dev] [Bug 176] Initialization (getILoggerFactory) is not thread safe

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Wed Jul 6 16:46:13 CEST 2011


http://bugzilla.slf4j.org/show_bug.cgi?id=176

--- Comment #10 from Ceki Gulcu <listid at qos.ch> 2011-07-06 16:46:13 CEST ---

> 1. Fixing this in slf4j is the only way to fix the problem for *all*
> implementations, not just logback. I understand that you want to keep slf4j as
> dumb as possible, but in this case I would argue that it's simply not possible.

I am just exploring options here.

> 2. Spawning separate threads for initialization is not guaranteed to fix the
> problem. It might work on one machine and fail on another due to race
> conditions.

I know. That's why I wrote "little or no impact".

> 3. According to JLS, variables accessed from different threads must be marked
> as volatile or accessed while holding a lock. This part of the fix must be in
> slf4j, not in logback.

Yes, INITIALIZATION_STATE needs to be marked as volatile but that's
only one small part of the issue at hand.

> What do you think of Ryan's proposed fix?

It's pretty good.

-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the slf4j-dev mailing list