Data processing apparatus and method for performing lock-protected processing operations for multiple threads
First Claim
1. A data processing apparatus for executing a plurality of threads, the data processing apparatus being coupled to memory via an interconnect, and comprising:
- processing circuitry configured to perform processing operations required by said plurality of threads, said processing operations including a lock-protected processing operation with which a lock is associated, the lock needing to be acquired in memory before the processing circuitry performs the lock-protected processing operation;
baton maintenance circuitry configured to maintain a baton in association with the plurality of threads, the baton forming a proxy for the lock, and the baton maintenance circuitry being configured to allocate the baton between the plurality of threads; and
a storage structure, separate from memory and associated with said plurality of threads, in which the baton maintenance circuitry is configured to maintain the baton;
the processing circuitry being configured to communicate with the baton maintenance circuitry so that, once the lock has been acquired in memory for one of said plurality of threads, the processing circuitry performs the lock-protected processing operation for multiple threads of said plurality of threads before the lock is released in memory, the baton maintenance circuitry being configured to identify a current thread amongst said multiple threads for which the lock-protected processing operation is to be performed by allocating the baton to that current thread;
wherein when the processing circuitry has performed the lock-protected processing operation for a thread, the processing circuitry is configured to issue a pass baton request to the baton maintenance circuitry, the baton maintenance circuitry being responsive to the pass baton request to determine whether there are any remaining threads amongst said multiple threads for which the lock-protected processing operation still needs to be performed, and if so, to allocate the baton to one of said remaining threads; and
wherein each thread comprises a sequence of instructions, and for a thread that requires the lock-protected processing operation to be performed, the thread includes a pass baton instruction which is executed by the processing circuitry once the lock-protected processing operation has been performed for that thread, and which causes the processing circuitry to issue the pass baton request to the baton maintenance circuitry.
1 Assignment
0 Petitions
Accused Products
Abstract
A data processing apparatus and method are provided for executing a plurality of threads. Processing circuitry performs processing operations required by the plurality of threads, the processing operations including a lock-protected processing operation with which a lock is associated, where the lock needs to be acquired before the processing circuitry performs the lock-protected processing operation. Baton maintenance circuitry is used to maintain a baton in association with the plurality of threads, the baton forming a proxy for the lock, and the baton maintenance circuitry being configured to allocate the baton between the threads. Via communication between the processing circuitry and the baton maintenance circuitry, once the lock has been acquired for one of the threads, the processing circuitry performs the lock-protected processing operation for multiple threads before the lock is released, with the baton maintenance circuitry identifying a current thread amongst the multiple threads for which the lock-protected processing operation is to be performed by allocating the baton to that current thread. The baton can hence be passed from one thread to the next, without needing to release and re-acquire the lock. This provides a significant performance improvement when performing lock-protected processing operations across multiple threads.
4 Citations
24 Claims
-
1. A data processing apparatus for executing a plurality of threads, the data processing apparatus being coupled to memory via an interconnect, and comprising:
-
processing circuitry configured to perform processing operations required by said plurality of threads, said processing operations including a lock-protected processing operation with which a lock is associated, the lock needing to be acquired in memory before the processing circuitry performs the lock-protected processing operation; baton maintenance circuitry configured to maintain a baton in association with the plurality of threads, the baton forming a proxy for the lock, and the baton maintenance circuitry being configured to allocate the baton between the plurality of threads; and a storage structure, separate from memory and associated with said plurality of threads, in which the baton maintenance circuitry is configured to maintain the baton; the processing circuitry being configured to communicate with the baton maintenance circuitry so that, once the lock has been acquired in memory for one of said plurality of threads, the processing circuitry performs the lock-protected processing operation for multiple threads of said plurality of threads before the lock is released in memory, the baton maintenance circuitry being configured to identify a current thread amongst said multiple threads for which the lock-protected processing operation is to be performed by allocating the baton to that current thread; wherein when the processing circuitry has performed the lock-protected processing operation for a thread, the processing circuitry is configured to issue a pass baton request to the baton maintenance circuitry, the baton maintenance circuitry being responsive to the pass baton request to determine whether there are any remaining threads amongst said multiple threads for which the lock-protected processing operation still needs to be performed, and if so, to allocate the baton to one of said remaining threads; and wherein each thread comprises a sequence of instructions, and for a thread that requires the lock-protected processing operation to be performed, the thread includes a pass baton instruction which is executed by the processing circuitry once the lock-protected processing operation has been performed for that thread, and which causes the processing circuitry to issue the pass baton request to the baton maintenance circuitry. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24)
-
-
22. A method of executing a plurality of threads within a data processing apparatus, each thread comprising a sequence of instructions, the method comprising:
-
performing processing operations required by said plurality of threads within processing circuitry of the data processing apparatus, said processing operations including a lock-protected processing operation with which a lock is associated, the lock needing to be acquired in memory before the processing circuitry performs the lock-protected processing operation; employing baton maintenance circuitry to maintain a baton in a storage structure separate from memory and associated with said plurality of threads, in association with the plurality of threads, the baton forming a proxy for the lock, and allocating the baton between the plurality of threads; once the lock has been acquired in memory for one of said plurality of threads, performing the lock-protected processing operation for multiple threads of said plurality of threads before the lock is released in memory, and identifying to the processing circuitry a current thread amongst said multiple threads for which the lock-protected processing operation is to be performed by allocating the baton to that current thread; and when the lock-protected processing operation has been performed for a thread, issuing a pass baton request to the baton maintenance circuitry, the baton maintenance circuitry being responsive to the pass baton request to determine whether there are any remaining threads amongst said multiple threads for which the lock-protected processing operation still needs to be performed, and if so, to allocate the baton to one of said remaining threads; and for a thread that requires the lock-protected processing operation to be performed, the thread includes a pass baton instruction which is executed once the lock-protected processing operation has been performed for that thread, and which causes the pass baton request to be issued to the baton maintenance circuitry.
-
-
23. A data processing apparatus for executing a plurality of threads, comprising:
-
means for performing processing operations required by said plurality of threads, said processing operations including a lock-protected processing operation with which a lock is associated, the lock needing to be acquired in memory before the processing means performs the lock-protected processing operation; means for maintaining a baton in association with the plurality of threads, the baton forming a proxy for the lock, and the means for maintaining a baton further for allocating the baton between the plurality of threads; and a storage structure, separate from memory and associated with said plurality of threads, in which the means for maintaining a baton is configured to maintain the baton; the means for performing processing operations including means for communicating with the means for maintaining a baton so that, once the lock has been acquired in memory for one of said plurality of threads, the means for performing processing operations performs the lock-protected processing operation for multiple threads of said plurality of threads before the lock is released in memory, the means for maintaining a baton including means for identifying a current thread amongst said multiple threads for which the lock-protected processing operation is to be performed by allocating the baton to that current thread; wherein when the means for performing processing operations has performed the lock-protected processing operation for a thread, the means for performing processing operations is configured to issue a pass baton request to the baton maintenance circuitry, the means for maintaining a baton being responsive to the pass baton request to determine whether there are any remaining threads amongst said multiple threads for which the lock-protected processing operation still needs to be performed, and if so, to allocate the baton to one of said remaining threads; and wherein each thread comprises a sequence of instructions, and for a thread that requires the lock-protected processing operation to be performed, the thread includes a pass baton instruction which is executed by the means for performing processing operations once the lock-protected processing operation has been performed for that thread, and which causes the means for performing processing operations to issue the pass baton request to the means for maintaining a baton.
-
Specification