← Back to Patent Explorer
EP0145889A2 Expired / Lapsed EP ⏱️ 0.0 years remaining

Non-spinning task locking using compare and swap

Assignee: International Business Machines Corp
•
Filing: 1984-10-19
•
Granted: —
•
Expires: 2004-10-19
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract @ A method for controlling both shared and exclusive access for a resource in a multiprocessor system wherein a first-in/first-out queue is formed for tasks suspended while awaiting access and wherein access to the resource provides that control of access required for manipulation of the first-in/first-out queue which is not provided by the atomic nature of compare (double) and swap. Each member of the queue has indicators of the access which it requested and of the next most recently enqueued member which has a corresponding indicator. A lockword is established having two parts, a lock flag indicating the status of the resource, whether available, under shared ownership or under exclusive ownership and a lock pointer pointing to the most recently enqueued task. In requesting or releasing access, an initial guess is made as to the value of the lockword and a projected lockword is calculated based on the guess. Then an atomic reference is made to the lockword during which no other multiprocessor has access to the lockword. During the atomic reference, the lockword is compared to the guess of the lockword and if the guess is correct, the lockword is replaced by the projected lockword which rearranges the queue for the requesting or releasing task. If the guess was incorrect, the value of the lockword is used to calculate another projected lockword. If another task can effect the next tasks to gain access, the process with the atomic reference is repeated until no intervening changes occur between atomic references.

Inventors

  • 👤 Roger Eldred Hough

Bibliographic Details

Application Number —
Jurisdiction EP
Data Source google_patents
Last Synchronized 2026-10-25 11:42
CPC Classifications
G; G06; G06F; G06F9/00; G06F9/06; G06F9/46; G06F9/52

Claims Analysis

Total Claims: 8
Claim 1
Independent Claim 209 words
A method for controlling access for a resource in a multi-task system with a first-in/first-out queue, comprising the steps of: providing a first-in/first-out queue composed of entries for each task awaiting access to said resource, each entry containing an indicator for the next most recently enqueued task, and the entry for the least recently enqueued task containing an indicator of its being least recently enqueued; providing storage space for a current lockword accessible to each task, said lockword containing a lock flag indicating the availability of said resource and a lock pointer pointing to the entry in the queue of the most recently enqueued task; requesting a change in access of a task; estimating a value for said lockword; projecting a value for a first new lockword based on the estimated lockword and the requested change; performing a first atomic reference with said task on said current lockword during which no other task can perform a similar atomic reference on said current lockword, said performance of said first atomic reference comprising comparing said estimated current lockword with said current lockword and, if said estimated current lockword matches said current lockword, replacing said current lockword with the value of said first projected new lockword, thereby changing access to said resource.
Claim 2
Independent Claim 209 words
A method for controlling access for a resource in a multi-task system with a first-in/first-out queue, comprising the steps of: providing a first-in/first-out queue composed of entries for each task awaiting access to said resource, each entry containing an indicator for the next most recently enqueued task, and the entry for the least recently enqueued task containing an indicator of its being least recently enqueued; providing storage space for a current lockword accessible to each task, said lockword containing a lock flag indicating the availability of said resource and a lock pointer pointing to the entry in the queue of the most recently enqueued task; requesting a change in access of a task; estimating a value for said lockword; projecting a value for a first new lockword based on the estimated lockword and the requested change; performing a first atomic reference with said task on said current lockword during which no other task can perform a similar atomic reference on said current lockword, said performance of said first atomic reference comprising comparing said estimated current lockword with said current lockword and, if said estimated current lockword matches said current lockword, replacing said current lockword with the value of said first projected new lockword, thereby changing access to said resource.
Claim 3
Dependent Claim 44 words
A method for controlling access to a resource, as recited in Claim 1, wherein, for said requested change being a request for access, the first occurrence of said estimating step is a step estimating said current lockword to indicate that said resource is available.
Claim 4
Dependent Claim 49 words
A method for controlling access to a resource, as recited in Claim 1, wherein, for said requested change being a request for release of said access, the first occurrence of said estimating step is a step estimating said current lockword to point to no entry for an enqueued task.
Claim 5
Dependent Claim 96 words
A method for controlling access to a resource, as recited in Claim 1, further comprising: projecting a value for a second new lockword based on said current lockword; and performing a second atomic reference with said task on said current lockword if other tasks can change the entries to said queue gaining access to said resource as a result of said requested change; wherein said steps of projecting a second new lockword and performing a second atomic reference are executed if said estimated current lockword does not match said current lockword in said first atomic reference.
Claim 6
Dependent Claim 75 words
A method for controlling access to a resource, as recited in Claim 1, wherein providing a queue comprises providing a storage space for a task deferral control block for each task awaiting access to said resource, each task deferral control block containing a pointer to the location of the next most recently enqueued task deferral control block and wherein said lock pointer points to the location of the most recently enqueued task deferral control block.
Claim 7
Dependent Claim 57 words
A method for controlling access to a resource, as recited in Claim 1, wherein said step of performing a first atomic reference further comprises replacing said estimated value of said current lockword with the actual value of said current lockword if said estimated value of current lockword does not match the actual value of said current lockword.
Claim 8
Dependent Claim 43 words
A method for controlling access to a resource, as recited in Claim 1, wherein said access to said resource provides that control of access required for manipulation of said first-in/first-out queue which is not provided by the atomic nature of said atomic references.

References Cited (Backward Citations)

No citation records indexed.

USPTO Annuity & Maintenance Windows

Maintenance schedule is calculated for granted US utility patents.

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag