Synchronization techniques in a multithreaded environment
First Claim
1. A method in a multithreaded architecture computer system for processing of a thread waiting for access to a memory location, the multithreaded architecture computer system having a plurality of threads, the method comprising:
- when access by a thread to the memory location is blocked,enabling an exception to be raised each time the memory location is accessed while execution of the thread is blocked, wherein the raising of the exception is enabled by setting a trap bit associated with the memory location, andblocking execution of the thread so that the thread does not attempt to access the memory location before the thread is restarted; and
detecting access to the memory location while execution of the thread is blocked and the trap bit associated with the memory location is set;
raising the exception as a result of the detected access to the memory location while execution of the thread is blocked and the trap bit associated with the memory location is set;
in response to the exception being raised,completing the detected access to the memory location,restarting execution of the thread in response to completing the detected access so that the thread can attempt to access the memory location,if access to the memory location by the thread is successful, allowing the thread to continue its execution, andif access to the memory location by the thread is not successful,enabling the exception to be raised each time the memory location is accessed while execution of the thread is blocked, wherein the raising of the exception is enabled by setting a trap bit associated with the memory location, andblocking execution of the thread so that the thread does not attempt to access the memory location before the thread is restarted.
0 Assignments
0 Petitions
Accused Products
Abstract
Various techniques for manipulating data using access states of memory, access control fields of pointers and operations, and exception raising and exception trapping in a multithreaded computer system. In particular, the techniques include synchronization support for a thread blocked in a word, demand evaluation of values, parallel access of multiple threads to a list, synchronized and unsynchronized access to a data buffer, use of forwarding to avoid checking for an end of a buffer, use of sentinel word to detect access past a data structure, concurrent access to a word of memory using different synchronization access modes, and use of trapping to detect access to restricted memory.
146 Citations
31 Claims
-
1. A method in a multithreaded architecture computer system for processing of a thread waiting for access to a memory location, the multithreaded architecture computer system having a plurality of threads, the method comprising:
-
when access by a thread to the memory location is blocked, enabling an exception to be raised each time the memory location is accessed while execution of the thread is blocked, wherein the raising of the exception is enabled by setting a trap bit associated with the memory location, and blocking execution of the thread so that the thread does not attempt to access the memory location before the thread is restarted; and detecting access to the memory location while execution of the thread is blocked and the trap bit associated with the memory location is set; raising the exception as a result of the detected access to the memory location while execution of the thread is blocked and the trap bit associated with the memory location is set; in response to the exception being raised, completing the detected access to the memory location, restarting execution of the thread in response to completing the detected access so that the thread can attempt to access the memory location, if access to the memory location by the thread is successful, allowing the thread to continue its execution, and if access to the memory location by the thread is not successful, enabling the exception to be raised each time the memory location is accessed while execution of the thread is blocked, wherein the raising of the exception is enabled by setting a trap bit associated with the memory location, and blocking execution of the thread so that the thread does not attempt to access the memory location before the thread is restarted. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
-
-
18. A computer-readable medium containing a data structure comprising:
-
a reference stored in a blocking memory location, the reference identifying a waiter list data structure; and the waiter list data structure containing information identifying a thread that is blocked waiting for access to the blocking memory location and identifying a prior value of the blocking memory location prior to the reference being stored in the blocking memory location, wherein the execution of the thread is blocked so that the thread does not attempt to access the blocking memory location before the thread is restarted as a result of the blocking memory location being accessed; and wherein each time the blocking memory location is accessed, the reference of the blocking memory location is used to access the waiter list data structure, which is used to identify the thread that is blocked and the prior value of the blocking memory location, so that the thread can be restarted. - View Dependent Claims (19, 20, 21, 22)
-
-
23. A method in a computer system for waiting for access to a memory location, comprising:
-
under control of a first thread, attempting to access the memory location, and when the memory location cannot be accessed, enabling a trap to occur each time the memory location is accessed while execution of the first thread is blocked; blocking execution of the first thread so that the first thread does not attempt to access the memory location before a thread other than the first thread attempts to access the memory location; under control of the thread other than the first thread, attempting to access the memory location wherein the trap occurs; in response to the trap occurring as a result of the thread other than the first thread accessing the memory location, transferring control to a trap handler; under control of the trap handler, unblocking execution of the first thread so that the first thread can attempt to access the memory location; and allowing access to the memory location by the first thread. - View Dependent Claims (24, 25, 26, 27, 28, 29, 30, 31)
-
Specification