![]() ![]() Some programmable processors provide a single instruction to perform the desired operation others may require that the fetch-and-increment operations be protected by a lower-level synchronization primitive. The word “Atomic” in the function name indicates that the fetch-and-increment operation must not be interrupted by some other thread's access of or operation on the variable. AtomicFetchAndIncrement increments a variable (in this case, the instance variable TicketCounter) and returns the value of the variable (ticket lock implementations can use the variable's value either before or after incrementing). WaitInLine obtains a ticket value from a counter by using AtomicFetchAndIncrement (line 60). Synchronization facilities built on lower-level synchronization primitives, or on more complex intrinsic atomic operations that can be performed by a processor, can provide the sophisticated semantics a program may need, and efficient implementations of those synchronization facilities may permit a multithreaded program that uses them to operate faster.Ī thread or process that wishes to use a shared, single-access resource (analogous to the clerk in the real world) calls WaitInLine (line 50) to await its turn. Moreover, the memory traffic generated by simple test-and-set locks can impact the execution speed of the entire program. For example, if many threads use such a mechanism to protect a highly-contended resource, scheduling and timing vagaries may result in predominantly (or only) one of the threads actually being allowed to use the resource for extended periods of time. However, simple test-and-set locks may not provide adequately sophisticated semantics for complex programs. ![]() A TAS instruction can be encapsulated in a loop to form a simple test-and-set lock, which can protect a shared, single-access resource against multiple simultaneous attempts by different threads to change the state of the resource. One of the simplest primitives is called a test-and-set (“TAS”) instruction. Inter-thread (inter-process) synchronization in multithreaded programs is usually based on low-level functions supported by the hardware and called, aptly enough, synchronization primitives. G06F9/52- Program synchronisation Mutual exclusion, e.g.G06F9/46- Multiprogramming arrangements.using an internal store of processing equipment to receive or retain programs control units using stored programs, i.e. G06F9/06- Arrangements for program control, e.g. ![]() G06F9/00- Arrangements for program control, e.g.G06- COMPUTING CALCULATING OR COUNTING.Publication of US20070300226A1 publication Critical patent/US20070300226A1/en Application granted granted Critical Publication of US8434082B2 publication Critical patent/US8434082B2/en Status Expired - Fee Related legal-status Critical Current Adjusted expiration legal-status Critical Links Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.) Filing date Publication date Application filed by Intel Corp filed Critical Intel Corp Priority to US11/473,580 priority Critical patent/US8434082B2/en Assigned to INTEL CORPORATION reassignment INTEL CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Original Assignee Intel Corp Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.) Bliss Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.) Granted Application number US11/473,580 Other versions US8434082B2 Google Patents Efficient ticket lock synchronization implementation using early wakeup in the presence of oversubscriptionĭownload PDF Info Publication number US20070300226A1 US20070300226A1 US11/473,580 US47358006A US2007300226A1 US 20070300226 A1 US20070300226 A1 US 20070300226A1 US 47358006 A US47358006 A US 47358006A US 2007300226 A1 US2007300226 A1 US 2007300226A1 Authority US United States Prior art keywords value ticket polling thread memory location Prior art date Legal status (The legal status is an assumption and is not a legal conclusion. Google Patents US20070300226A1 - Efficient ticket lock synchronization implementation using early wakeup in the presence of oversubscription US20070300226A1 - Efficient ticket lock synchronization implementation using early wakeup in the presence of oversubscription ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |