Task synchronization mechanism and method
First Claim
1. An apparatus comprising:
- a plurality of processors;
a memory coupled to the plurality of processors;
a global lock residing in the memory;
a plurality of processor-specific locks residing in the memory, each processor-specific lock corresponding to one of the plurality of processors; and
a task synchronization mechanism residing in the memory and executed by at least one of the plurality of processors, the task synchronization mechanism controlling access by the plurality of processors to a shared resource, the task synchronization mechanism updating one of the plurality of processor-specific locks when the requested access is a request for shared access to the shared resource, the task synchronization mechanism updating the global lock when the requested access is for exclusive access to the shared resource.
1 Assignment
0 Petitions
Accused Products
Abstract
A task synchronization mechanism operates on a global lock that is shared between processors an on local locks that are not shared between processors. The local locks are processor-specific locks. Each processor-specific lock is dedicated to a particular processor in the system. When shared access to a resource is required, a processor updates its processor-specific lock to indicate the processor is sharing the resource. Because each processor-specific lock is dedicated to a particular processor, this eliminates a significant portion of the memory bus traffic associated with all processors reading and updating the same lock. When exclusive access to a resource is required, the requesting processor waits until the count of all processor-specific locks indicate that none of these processors have a lock on the resource. Once no processor has a lock on the resource, exclusive access to the resource may be granted.
16 Citations
24 Claims
-
1. An apparatus comprising:
-
a plurality of processors; a memory coupled to the plurality of processors; a global lock residing in the memory; a plurality of processor-specific locks residing in the memory, each processor-specific lock corresponding to one of the plurality of processors; and a task synchronization mechanism residing in the memory and executed by at least one of the plurality of processors, the task synchronization mechanism controlling access by the plurality of processors to a shared resource, the task synchronization mechanism updating one of the plurality of processor-specific locks when the requested access is a request for shared access to the shared resource, the task synchronization mechanism updating the global lock when the requested access is for exclusive access to the shared resource. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. An apparatus comprising:
-
a plurality of processors; a memory coupled to the plurality of processors; a global lock residing in the memory, the global lock including an exclusive lock; a plurality of processor-specific locks residing in the memory, each processor-specific lock corresponding to one of the plurality of processors, each processor-specific lock including a count of shared locks; and a task synchronization mechanism residing in the memory and executed by at least one of the plurality of processors, the task synchronization mechanism controlling access by the plurality of processors to at least one shared resource, the task synchronization mechanism updating one of the plurality of processor-specific locks when the requested access is a request for shared access to a first shared resource, the task synchronization mechanism updating the global lock when the requested access is for exclusive access to the first shared resource and when the count of shared locks for the plurality of processor-specific locks indicate that none of the plurality of processor-specific locks are sharing the first shared resource. - View Dependent Claims (10, 11)
-
-
12. A method for controlling access to a shared resource in a multiprocessor computer system, the method comprising the steps of:
-
defining a global lock; defining a processor-specific lock for each processor in the multiprocessor computer system; updating one of the plurality of processor-specific locks when a requested access is a request for shared access to the shared resource; and updating the global lock when the requested access is for exclusive access to the shared resource. - View Dependent Claims (13, 14)
-
-
15. A method for controlling access to a shared resource in a multiprocessor computer system, the method comprising the steps of:
-
(A) defining a global lock comprising; (A1) a shared lock that includes a count of shared locks; (A2) an exclusive lock; and (A3) a mode setting that may be set to fast or slow; (B) defining a processor-specific lock for each processor in the multiprocessor computer system, each processor-specific lock comprising; (B1) a count of shared locks; and (B2) a mode setting that may be set to fast or slow; (C) receiving a request for access to the shared resource; (D) reading the mode setting of a processor-specific lock that corresponds to the request; (E) if the mode setting of the processor-specific lock is fast, and if the request for access is a request for shared access, updating one of the plurality of processor-specific locks; (F) if the mode setting of the processor-specific lock is slow, performing the steps of; (F1) reading the mode setting of the global lock; (F2) if the mode setting of the global lock is fast, updating one of the plurality of processor-specific locks; and (F3) if the mode setting of the global lock is slow and if the shared count of each processor-specific lock is zero, updating the exclusive lock.
-
-
16. A computer-readable program product comprising:
-
(A) a task synchronization mechanism that controls access to a shared resource using a global lock and a plurality of processor-specific locks, the task synchronization mechanism updating one of the plurality of processor-specific locks when a requested access is a request for shared access to the shared resource, the task synchronization mechanism updating the global lock when the requested access is for exclusive access to the shared resource; and (B) recordable signal bearing media bearing the task synchronization mechanism. - View Dependent Claims (17, 18, 19, 20, 21, 22, 23)
-
-
24. A computer-readable program product comprising:
-
(A) a task synchronization mechanism that controls access by a plurality of processors to a shared resource using a global lock that includes an exclusive lock and a plurality of processor-specific locks that each include a count of shared locks, the task synchronization mechanism updating one of the plurality of processor-specific locks when a requested access is a request for shared access to a first shared resource, the task synchronization mechanism updating the global lock when the requested access is for exclusive access to the first shared resource and when the count of shared locks for the plurality of processor-specific locks indicate the shared resource is not being shared; and (B) recordable signal bearing media bearing the task synchronization mechanism.
-
Specification