Improve invariants in NonblockingQueue::append

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 19
    • Affects Version/s: 19
    • Component/s: hotspot
    • gc
    • b09

      NonblockingQueue::append has a somewhat complicated and limited set of invariants for the cases where the queue was (logically) empty and is being changed to non-empty.

      When NonblockingQueue::try_pop takes the last element from the queue, it performs some cleanup of the queue _head and _tail. The order of that cleanup is currently _tail then _head. The order doesn't affect the correctness of the algorithm. But if the order were reversed, i.e. _head then _tail, then the invariants in append could be improved. In particular, when append finds a NULL old_tail then the value of _head must also be NULL. That doesn't hold with the current order.

            Assignee:
            Kim Barrett
            Reporter:
            Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: