TWA -- Ticket Locks Augmented with a Waiting Array

The classic ticket lock consists of ticket and grant fields. Arriving threads atomically fetch-and-increment ticket and then wait for grant to become equal to the value returned by the fetch-and-increment primitive, at which point the thread holds the lock. The corresponding unlock operation simply...

Full description

Saved in:
Bibliographic Details
Main Authors Dice, Dave, Kogan, Alex
Format Journal Article
LanguageEnglish
Published 02.10.2018
Subjects
Online AccessGet full text

Cover

Loading…
Abstract The classic ticket lock consists of ticket and grant fields. Arriving threads atomically fetch-and-increment ticket and then wait for grant to become equal to the value returned by the fetch-and-increment primitive, at which point the thread holds the lock. The corresponding unlock operation simply increments grant. This simple design has short code paths and fast handover (transfer of ownership) under light contention, but may suffer degraded scalability under high contention when multiple threads busy wait on the grant field -- so-called global spinning. We propose a variation on ticket locks where long-term waiting threads wait on locations in a waiting array instead of busy waiting on the grant field. The single waiting array is shared among all locks. Short-term waiting is accomplished in the usual manner on the grant field. The resulting algorithm, TWA, improves on ticket locks by limiting the number of threads spinning on the grant field at any given time, reducing the number of remote caches requiring invalidation from the store that releases the lock. In turn, this accelerates handover, and since the lock is held throughout the handover operation, scalability improves. Under light or no contention, TWA yields performance comparable to the classic ticket lock, avoiding the complexity and extra accesses incurred by MCS locks in the handover path, but providing performance above or beyond that of MCS at high contention.
AbstractList The classic ticket lock consists of ticket and grant fields. Arriving threads atomically fetch-and-increment ticket and then wait for grant to become equal to the value returned by the fetch-and-increment primitive, at which point the thread holds the lock. The corresponding unlock operation simply increments grant. This simple design has short code paths and fast handover (transfer of ownership) under light contention, but may suffer degraded scalability under high contention when multiple threads busy wait on the grant field -- so-called global spinning. We propose a variation on ticket locks where long-term waiting threads wait on locations in a waiting array instead of busy waiting on the grant field. The single waiting array is shared among all locks. Short-term waiting is accomplished in the usual manner on the grant field. The resulting algorithm, TWA, improves on ticket locks by limiting the number of threads spinning on the grant field at any given time, reducing the number of remote caches requiring invalidation from the store that releases the lock. In turn, this accelerates handover, and since the lock is held throughout the handover operation, scalability improves. Under light or no contention, TWA yields performance comparable to the classic ticket lock, avoiding the complexity and extra accesses incurred by MCS locks in the handover path, but providing performance above or beyond that of MCS at high contention.
Author Kogan, Alex
Dice, Dave
Author_xml – sequence: 1
  givenname: Dave
  surname: Dice
  fullname: Dice, Dave
– sequence: 2
  givenname: Alex
  surname: Kogan
  fullname: Kogan, Alex
BackLink https://doi.org/10.48550/arXiv.1810.01573$$DView paper in arXiv
BookMark eNotzrFuwjAUhWEPdChpH6ATfgGncezr64wRakulSF0iMUa3sQELCMik0Lw9kHY60j8cfVM26Q6dZ-xFZqm2ANkrxd9wTqW9hUwCqkeW18uSC8Hr0G59z6tDuz3x8me9913vHb-EfsOJLyn0oVvzMkYantjDinYn__y_Cavf3-r5QlRfH5_zshJkUAlEqyXmPi-ss4qkIwdgDDntcwNGq28JILFwFlA77TDzLRjCVUFojQSVsNnf7YhujjHsKQ7NHd-MeHUF2e49ng
ContentType Journal Article
Copyright http://arxiv.org/licenses/nonexclusive-distrib/1.0
Copyright_xml – notice: http://arxiv.org/licenses/nonexclusive-distrib/1.0
DBID AKY
GOX
DOI 10.48550/arxiv.1810.01573
DatabaseName arXiv Computer Science
arXiv.org
DatabaseTitleList
Database_xml – sequence: 1
  dbid: GOX
  name: arXiv.org
  url: http://arxiv.org/find
  sourceTypes: Open Access Repository
DeliveryMethod fulltext_linktorsrc
ExternalDocumentID 1810_01573
GroupedDBID AKY
GOX
ID FETCH-LOGICAL-a673-7784172e298d83a1dad5566ad4e265643b155179d8574d4d70ec56a7f9a786153
IEDL.DBID GOX
IngestDate Mon Jan 08 05:39:54 EST 2024
IsDoiOpenAccess true
IsOpenAccess true
IsPeerReviewed false
IsScholarly false
Language English
LinkModel DirectLink
MergedId FETCHMERGED-LOGICAL-a673-7784172e298d83a1dad5566ad4e265643b155179d8574d4d70ec56a7f9a786153
OpenAccessLink https://arxiv.org/abs/1810.01573
ParticipantIDs arxiv_primary_1810_01573
PublicationCentury 2000
PublicationDate 2018-10-02
PublicationDateYYYYMMDD 2018-10-02
PublicationDate_xml – month: 10
  year: 2018
  text: 2018-10-02
  day: 02
PublicationDecade 2010
PublicationYear 2018
Score 1.710227
SecondaryResourceType preprint
Snippet The classic ticket lock consists of ticket and grant fields. Arriving threads atomically fetch-and-increment ticket and then wait for grant to become equal to...
SourceID arxiv
SourceType Open Access Repository
SubjectTerms Computer Science - Operating Systems
Title TWA -- Ticket Locks Augmented with a Waiting Array
URI https://arxiv.org/abs/1810.01573
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwdZ2_T8QgFMdf7m5yMRo1588wuKIt0AJjYzwvxuhSc90aeoDpYkyvZ7z_3get0cW1pcN7BL4f4PEtwHVqhXMusRTRVVLBvKRaCU9l4jjzqCjaxmqL53z5Kh6rrJoA-bkLY7qv9nPwB242tyg_yQ0KluRTmDIWSrYeXqrhcDJacY3tf9shY8ZHf0RicQD7I92RYuiOQ5i49yNg5aoglJKyxRHTkyecgTak2L5FO0xLwk4oMWRl2lCBjN92ZncM5eK-vFvS8VcF1OSSI6IqgSTgmFZWcZNaYzPkJIOJYAhMgjeBTKS2KpPCCouZWGe5kV4bqQJyncAMV_tuDsRbL1KGQyMXDaLKWqvMIaR47pxwjfKnMI8B1h-DG0UdYq9j7Gf_vzqHPVT6wciVXcCs77buEtW0b65iSr8B_YBxIQ
link.rule.ids 228,230,783,888
linkProvider Cornell University
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.atitle=TWA+--+Ticket+Locks+Augmented+with+a+Waiting+Array&rft.au=Dice%2C+Dave&rft.au=Kogan%2C+Alex&rft.date=2018-10-02&rft_id=info:doi/10.48550%2Farxiv.1810.01573&rft.externalDocID=1810_01573