Skip to content

Split global mutex into granular locks #22

@mark-e-deyoung

Description

@mark-e-deyoung

Problem

ServerState::mu is a single std::mutex protecting 8 data structures. Under 32 concurrent snapshot.capture requests, one lock serializes all allocation.

Proposed Solution

Split into three locks:

  • snapshots_mu: snaps + pinned_counts + lru_order + snap_counter
  • sessions_mu: sessions + sessionCount
  • event_mu: event_counter + event_log

No operation holds more than one lock currently, so this is a safe split.

References

  • Scalability audit item 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions