Claims
- 1. A method of synchronizing access to a resource in a computer system that includes a lock corresponding to said resource and a plurality of requesters that may attempt to access said resource, wherein said lock has at least three lock states, said method comprising:a first requester of said plurality of requesters requesting acquisition of said lock; if said lock is in a first state, said first requester setting said lock to a second state and acquiring said lock; if said lock is in said second state, said first requester setting said lock to a third state and spinning at a first rate; and if said lock is in said third state, said first requester spinning at a second rate.
- 2. The method as recited in claim 1, wherein said first state is indicative of said resource being available for acquisition.
- 3. The method as recited in claim 1, wherein said second state is indicative of said resource not being available for acquisition and causing a second requester to become a first waiting contender for said lock.
- 4. The method as recited in claim 3, wherein said first rate is faster than said second rate.
- 5. The method as recited in claim 1, wherein said third state is indicative of said resource not being available for acquisition and causing a third requester to become another waiting contender for said lock.
- 6. The method as recited in claim 1, wherein said spinning at a first rate includes executing a first software loop to query said lock to determine if said lock is in said first, second or third state.
- 7. The method as recited in claim 1, wherein said spinning at a second rate includes executing a second software loop to query said lock to determine if said lock is in said first, second or third state, wherein said second software loop includes a delay.
- 8. The method as recited in claim 1, wherein said first, second and third states correspond to three values in a register.
- 9. The method as recited in claim 8, wherein said first state is a free state.
- 10. The method as recited in claim 8, wherein said second state is a held state.
- 11. The method as recited in claim 8, wherein said third state is a wait state.
- 12. A computer system comprising:a resource; a plurality of requesters coupled to said resource and configured to request access to said resource; a lock coupled to said resource and configured to synchronize access to said resource, wherein said lock has at least a first state, a second state and a third state; wherein, in response to a first requester of said plurality of requesters determining that said lock is in said first state, said first requester of said plurality of requesters is configured to set said lock to said second state and acquire said lock; wherein, in response to a second requester of said plurality of requesters determining that said lock is in said second state, said second requester of said plurality of requesters is configured to set said lock to said third state and to spin at a first rate; and wherein, in response to a third requester of said plurality of requesters determining that said lock is in said third state, said third requester of said plurality of requesters is configured to spin at a second rate.
- 13. The computer system as recited in claim 12, wherein said first rate is faster than said second rate.
- 14. The computer system as recited in claim 12, wherein spinning at said first rate includes executing a first software loop to query said lock to determine if said lock is in said first, second or third state.
- 15. The computer system as recited in claim 14, wherein spinning at said second rate includes executing a second software loop to query said lock to determine if said lock is in said first, second or third state, wherein said second software loop includes a delay.
- 16. The computer system as recited in claim 15, wherein if said lock is in said second state, then said second requester of said plurality of requesters is configured to become a first waiting contender for said lock.
- 17. The computer system as recited in claim 12, wherein said first, second and third states correspond to three values in a register.
- 18. The computer system as recited in claim 17, wherein said first state is a free state.
- 19. The computer system as recited in claim 17, wherein said second state is a held state.
- 20. The computer system as recited in claim 17, wherein said third state is a wait state.
Parent Case Info
This application is a continuation of U.S. patent application Ser. No. 09/100,667, entitled “Hybrid Queue and Backoff Computer Resource Lock Featuring Different Spin Speeds Corresponding to Multiple States”, filed Jun. 19, 1998 now U.S. Pat. No. 6,148,300.
US Referenced Citations (18)
Foreign Referenced Citations (2)
Number |
Date |
Country |
0616709 |
Sep 1994 |
EP |
0817042 |
Jan 1998 |
EP |
Non-Patent Literature Citations (4)
Entry |
Dijkstra, “Solution of a Problem in Concurrent Programming Control,” Communications of the ACM, vol. 8, No. 9, Sep. 1965, p. 569. |
Gustavson, “The Scalable Coherent Interface and Related Standards Projects,” IEEE Micro, 1992, p. 10. |
International search report application number 99304532.7-2201 mailed Dec. 10, 2002. |
“Performance of Spin Lock Alternatives for Shared-Memory Multiprocessors”, Anderson, IEEE Transactions on Parallel and Distributed Systems, Jan. 1990, No. 1, New York, US. |
Continuations (1)
|
Number |
Date |
Country |
Parent |
09/100667 |
Jun 1998 |
US |
Child |
09/597863 |
|
US |