Change TicketSemaphore acquire to enqueue directly instead of trying tryAcquire first

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The current acquire path calls tryAcquire() before enqueueing: TicketHolder calls tryAcquire() and only then acquire(), and UnorderedTicketSemaphore::acquire() also starts with a tryAcquire() loop. This adds extra contention and complexity.

      Change the acquire path so that when a caller chooses to wait, it enqueues immediately without a prior tryAcquire(). Keep tryAcquire() as a separate non-blocking path for callers that want to avoid waiting.

            Assignee:
            Unassigned
            Reporter:
            Pol Pinol
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: