Log4j 2
  1. Log4j 2
  2. LOG4J2-3

Minimal (aka fine grained) locking

    Details

    • Type: Wish Wish
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-alpha1
    • Component/s: Core
    • Labels:
      None

      Description

      Most components of log4j 1.2 are not inherently thread-safe but depend on locks that are acquired after the threshold check and are not released until processing is completed. Unless the AsyncAppender is used, this effectively limits log4j 1.2 to handlng only one logging request at a time.

      Core classes in log4j 2.0 should not depend on external synchronization for thread safety.
      Immutable classes should be preferred in the logging pipeline.
      Class attributes (aka @Immutable and @ThreadSafe) should be used to document thread-safety.

        Activity

        Hide
        Ralph Goers added a comment -

        In my experimental branch java.util.concurrent is used quite a bit. Locking is as minimal as possible.

        Show
        Ralph Goers added a comment - In my experimental branch java.util.concurrent is used quite a bit. Locking is as minimal as possible.
        Hide
        Ralph Goers added a comment -

        In Log4j 2 the core components are designed to be immutable and thread safe. However, annotations aren't being used since everything is expected to work that way. I'm going to mark this as resolved, however feel free to reopen this if you believe more needs to be done.

        Show
        Ralph Goers added a comment - In Log4j 2 the core components are designed to be immutable and thread safe. However, annotations aren't being used since everything is expected to work that way. I'm going to mark this as resolved, however feel free to reopen this if you believe more needs to be done.
        Hide
        Ralph Goers added a comment -

        Closing since there have been no other comments since this was marked resolved.

        Show
        Ralph Goers added a comment - Closing since there have been no other comments since this was marked resolved.

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Curt Arnold
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development