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)
Ticket locks are implemented via atomic fetch-and-add and guarantee first-come, first-served fairness.
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.
Ticket locks assume that all tasks take similar amounts of time; mixing long and short tasks can introduce priority inversion problems.
All Facts (3)
Ticket locks are implemented via atomic fetch-and-add and guarantee first-come, first-served fairness.
50%UnverifiedIn a ticket lock, if a thread takes a number but does not check the "now serving" counter in time, the entire queue is blocked.
50%UnverifiedTicket locks assume that all tasks take similar amounts of time; mixing long and short tasks can introduce priority inversion problems.
50%