Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-89603

Audit usages of atomic operations on shared_ptrs

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability
    • Service Arch 2024-04-29

      Atomic operations such as atomic_load on {{shared_ptr}}s are not lock-free, they need to take a global mutex in order to coordinate the pointer and refcount updates. This might not be obvious when looking at the code, since atomic load/stores of primitive types usually translate to a single CPU instruction and are comparatively cheap.

      We should audit these usages to find possible performance problems in hot paths and to explicitly declare whether we want the atomic operation to be lock free or not, e.g. invarianting on atomic_is_lock_free().

            Assignee:
            Unassigned Unassigned
            Reporter:
            daniel.gomezferro@mongodb.com Daniel Gomez Ferro
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: