发明名称 Information handling system
摘要 <p>A semaphore 120 for controlling access to a shared resource in an information handling system is implemented using an atomic operation that compares an operand with a comparison value and, if the operand is equal to the comparison value, replaces the compared operand and up to three additional operands with replacement values. The semaphore has a first semaphore field 415 containing a value 435 and a sequence count 430 and a second semaphore field 420 containing a pointer 440 to a queue for the semaphore. The queue has zero or more entries 450 corresponding to waiters for the semaphore, each entry with a next entry having a pointer 455 to that next entry. To implement the semaphore, a previous value of the first semaphore field is saved as a comparison value 1310. A first replacement value 1320 containing an incremented sequence count is generated for the first semaphore field as a first operand in accordance with the specified operation. A second replacement value for the second semaphore field and a third replacement value 1330 for one of the queue entries are generated as second and third operands if the queue is being modified. The current value of the first semaphore field is thereafter compared with the comparison value including the sequence count to see if the current value matches the comparison value. If it does, then, atomically with the comparing step, the first operand is replaced with the first replacement value and, if the queue is being modified, one or both of the second and third operands are replaced with their corresponding replacement values. If the current value of the first semaphore field does not match the comparison value, the semaphore operation is retried, using a newly saved value of the semaphore field as a comparison value. <IMAGE></p>
申请公布号 EP0943993(A2) 申请公布日期 1999.09.22
申请号 EP19990302069 申请日期 1999.03.17
申请人 INTERNATIONAL BUSINESS MACHINES CORPORATION 发明人 AULT, DONALD F.;FORSYTHE, JOHN M.
分类号 G06F9/46;(IPC1-7):G06F9/46 主分类号 G06F9/46
代理机构 代理人
主权项
地址