发明名称 NON-SPINNING TASK LOCKING USING COMPARE AND SWAP
摘要 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 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 affect the next tasks to gain access, the process with the atomic reference is repeated until no intervening changes occur between atomic references.
申请公布号 DE3477972(D1) 申请公布日期 1989.06.01
申请号 DE19843477972 申请日期 1984.10.19
申请人 INTERNATIONAL BUSINESS MACHINES CORPORATION 发明人 HOUGH, ROGER ELDRED
分类号 G06F12/00;G06F9/46;G06F9/48;G06F9/52;G06F15/16;G06F15/177;(IPC1-7):G06F9/46 主分类号 G06F12/00
代理机构 代理人
主权项
地址