Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-466

Node._getChild(int) - why is synchronization required?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: TERMS_REFACTOR_BRANCH
    • Fix Version/s: None
    • Component/s: B+Tree
    • Labels:
      None

      Description

      com.bigdata.btree.Node._getChild() synchronizes internally on childRefs[]. Based on some anecdotal evidence, it appears that we might need to be synchronized here for mutation
      - but perhaps not for query. Look into this issue further as this could turn into a synchronization hot spot. There are comments in _getChild() on this topic.

      Testing should be performed under both mutation and concurrent query workloads.

      The worst case scenario for _getChild() would be in concurrent readers need to materialize different children of the same node. However, the synchronization blocks deliberately do NOT span the IO so even the worst case can only cause more context switches than would otherwise be desired, but will not block out threads during an IO.

      Another possible way to handle this is with a write/read on a volatile field on the Node.

        Attachments

          Activity

            People

            Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: