Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-10671

Use double checked locking pattern for lazy initialization of the WhitelistedClassesResourceGuard singleton

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 5.0.0
    • None
    • None

    Description

      The CMS uses the WhitelistedClassesResourceGuard to control access to resources. This class is a singleton, and currently uses a synchronized lock to check whether it has already been initialized. This effectively serializes all accesses to resources (concurrent requests for resources have to wait for each other because of the lock), which makes the CMS unnecessary slow.

      Instead we should use the double checked locking pattern to initialize the class, which avoids the locking overhead in concurrent threads. See https://en.wikipedia.org/wiki/Double-checked_locking for details.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aschrijvers Ard Schrijvers
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: