sipservlet-spec
  1. sipservlet-spec
  2. SIPSERVLET_SPEC-30

SipSession and SipApplicationSession need proper happensBefore concurrency guarantees for attributes

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-pr
    • Labels:
      None

      Description

      Given the code:
      Thread A:
      session.setAttribute("foo", myClassInstance);

      Thread B:
      session.getAttribute("Foo");

      If the call to setAttribute happens-before the call to getAttribute, the result of the get shouild return the value passed in to the set. This is not currently guaranteed by the SipServlet API. Put differently, as an app developer, I would like the getting, setting and removal of attributes in sessions to behave like a ConcurrentHashMap in terms of memory visibility.

      I know that we are addressing threading issues in other proposals (the work on Executors), but that work is mostly about scheduling of triggers with respect to a context (for example a SipApplicationSession) and is not strictly about memory visibility. This feels like something that is missing from the spec that is counter-intuitive to the average developer.

        Activity

        Hide
        binod added a comment -

        With the current concurrency behavior, the significance of this issue become much smaller, since the unit of concurrency is now at the level of SipApplicationSession. We have still clarified the happens before requirement in the AttributeStore interface. I am marking this as fixed.

        Show
        binod added a comment - With the current concurrency behavior, the significance of this issue become much smaller, since the unit of concurrency is now at the level of SipApplicationSession. We have still clarified the happens before requirement in the AttributeStore interface. I am marking this as fixed.

          People

          • Assignee:
            binod
            Reporter:
            tomrstrickland
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: