[KongchangAI]
Conceptticket lock

Ticket Lock

A mutual exclusion lock that achieves first-come, first-served fairness based on atomic addition, using two counters, the next ticket number and the currently serving number, to enforce that threads acquire the lock in ticket order.

Timeline (last 90 days)

Nov 12

Ticket locks are implemented via atomic fetch-and-add and guarantee first-come, first-served fairness.

Unverified50%
Nov 12

In a ticket lock, if a thread takes a number but does not check the "now serving" counter in time, the entire queue is blocked.

Unverified50%
Nov 12

Ticket locks assume that all tasks take similar amounts of time; mixing long and short tasks can introduce priority inversion problems.

Unverified50%

All Facts (3)

Source Articles