Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2804

LifecycleImpl _firstRequestProcessed should be marked as volatile

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.1
    • JSR-314
    • None

    Description

      Checking how _firstRequestProcessed works, I notice we can do some enhancements LifecycleImpl and LifecycleFactoryImpl. In both classes, we use synchronized blocks to access common methods, but that is not really necessary, we can do other alternatives like ConcurrentHashMap and CopyOnWriteArrayList and they will be more effective.

      Note LifecycleImpl instance is shared by multiple threads at the same time, so it must be thread safe. If we have variables that changes inside it, we must ensure visibility adding "final" and "volatile" modifiers too when necessary.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: