Recoverable spin lock system
DCFirst Claim
1. A method for recovering spin locks in a system having one or more processes capable of accessing a shared resource, the system providing a lock indicating exclusive access of the shared resource by a single process and enabling one or more processes to repeatedly attempt to gain ownership of the lock when exclusive access to the shared resource is desired, said method for recovering spin locks comprising the steps of:
- generating a queue structure including a process currently having exclusive access to the lock and adding processes that desire ownership of the lock to said queue structure;
setting a first status flag indicating a desire of one of said processes to be added to said queue structure;
setting a second status flag indicating that said one process is currently modifying the queue structure;
monitoring a third status flag indicating whether said queue structure is being restored and not attempting to modify said queue structure if said queue structure is being restored;
conducting a cleanup process if one or more of said processes indicated by said first status flag set have terminated, said cleanup process removing said one or more of said terminated processes from said queue structure, setting said third status flag to indicate that recovery of said queue structure is in process, and recovering said queue structure after all modification activity on said queue structure has finished; and
resetting said third status flag after completion of said cleanup process to indicate that said recovery process has completed.
7 Assignments
Litigations
1 Petition
Accused Products
Abstract
A method for recovering spin locks in a system having one or more processes capable of accessing a shared resource, the system providing a lock indicating exclusive access to the shared resource by a single process and enabling one or more processes to repeatedly attempt to gain access to the lock when ownership of the shared resource is desired. The method includes generating a linked list queue structure containing a first process currently having exclusive access to the lock and one or more processes added to the queue structure to spin on the lock, each process capable of modifying the queue structure by obtaining exclusive access of the lock from a process having exclusive access of the lock and releasing the lock to another process in the linked list queue structure; detecting when one or more processes having exclusive access to the lock terminates, and upon detection, removing the terminated process from the queue structure, and restoring consistency to said linked list queue structure.
70 Citations
17 Claims
-
1. A method for recovering spin locks in a system having one or more processes capable of accessing a shared resource, the system providing a lock indicating exclusive access of the shared resource by a single process and enabling one or more processes to repeatedly attempt to gain ownership of the lock when exclusive access to the shared resource is desired, said method for recovering spin locks comprising the steps of:
-
generating a queue structure including a process currently having exclusive access to the lock and adding processes that desire ownership of the lock to said queue structure; setting a first status flag indicating a desire of one of said processes to be added to said queue structure; setting a second status flag indicating that said one process is currently modifying the queue structure; monitoring a third status flag indicating whether said queue structure is being restored and not attempting to modify said queue structure if said queue structure is being restored; conducting a cleanup process if one or more of said processes indicated by said first status flag set have terminated, said cleanup process removing said one or more of said terminated processes from said queue structure, setting said third status flag to indicate that recovery of said queue structure is in process, and recovering said queue structure after all modification activity on said queue structure has finished; and resetting said third status flag after completion of said cleanup process to indicate that said recovery process has completed. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A method for providing multiple processes with mutually exclusive access to a shared resource in a system having a lock associated with the shared resource, possession of the lock signifying exclusive access to the shared resource, wherein processes desiring access to the shared resource spin on the lock until the lock is acquired, the method comprising the steps of:
-
maintaining a linked queue structure of data records corresponding to a queue of processes including processes spinning on the lock and a process possessing the lock, one data record per process; transferring the lock from the process possessing the lock to a process next in the queue; conducting a cleanup process if one or more processes in the queue have terminated, said cleanup process removing said one or more terminated processes from the queue and reassembling the linked queue structure. - View Dependent Claims (14, 15, 16)
-
-
17. A method for providing multiple processes with mutually exclusive access to a shared resource in a system having a lock associated with the shared resource, possession of the lock signifying exclusive access to the shared resource, wherein processes desiring access to the shared resource spin on the lock until the lock is acquired, the method comprising the steps of:
-
step for maintaining a linked queue structure of data records corresponding to a queue of processes including processes spinning on the lock and a process possessing the lock, one data record per process spinning on the lock or possessing the lock; step for acquiring the lock by a first of said multiple processes; step for releasing the lock by the first of said multiple processes; step for preventing the multiple processes from modifying the linked queue structure during the cleanup process; step for conducting a cleanup process if one or more processes in the queue have terminated, the cleanup process including removing said one or more terminated processes from the queue and reassembling the linked queue structure; step for preventing the multiple processes from modifying the linked queue structure during the cleanup process; and step for preventing initiation of the cleanup process while the linked queue structure is being modified.
-
Specification