METHOD, APPARATUS AND ARTICLE OF MANUFACTURE FOR TIMEOUT WAITS ON LOCKS
First Claim
1. A computer-implemented method for performing a timeout wait for a thread requesting access to a shared resource locked by a process lock, comprising:
- sending, by a first thread, a timeout request message to a timeout handler process;
transitioning the first thread to an indefinitely blocked state;
determining, from the timeout request message, a timeout period after which the first thread should be unblocked from the indefinitely blocked state while waiting to access to the shared resource;
storing the timeout request message in a data structure configured to store a plurality of timeout request messages; and
upon determining that the timeout period has elapsed and that the first thread is still requesting access to the shared resource, sending a wakeup message to a message queue associated with the indefinitely blocked thread.
1 Assignment
0 Petitions
Accused Products
Abstract
Embodiments of the invention provide techniques for performing timeout waits of process threads. Generally, a thread requesting access to locked resource sends a timeout request to a timeout handler process, and then goes to sleep. The timeout request is received by a receiving thread of the timeout handler process. The receiving thread may insert the timeout request into a minimum heap of timeout requests, and may determine whether the inserted request is due earlier than any of the existing timeout requests. If so, the receiving thread may interrupt a timing thread of the timeout handler process. The timing thread may then wait until reaching the requested timeout, and then send a wakeup message to the sleeping thread.
39 Citations
20 Claims
-
1. A computer-implemented method for performing a timeout wait for a thread requesting access to a shared resource locked by a process lock, comprising:
-
sending, by a first thread, a timeout request message to a timeout handler process; transitioning the first thread to an indefinitely blocked state; determining, from the timeout request message, a timeout period after which the first thread should be unblocked from the indefinitely blocked state while waiting to access to the shared resource; storing the timeout request message in a data structure configured to store a plurality of timeout request messages; and upon determining that the timeout period has elapsed and that the first thread is still requesting access to the shared resource, sending a wakeup message to a message queue associated with the indefinitely blocked thread. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A computer-readable storage medium containing a program, which when executed on a processor performs an operation, comprising:
-
sending, by a first thread, a timeout request message to a timeout handler process; transitioning the first thread to an indefinitely blocked state; determining, from the timeout request message, a timeout period after which the first thread should be unblocked from the indefinitely blocked state while waiting to access to the shared resource; storing the timeout request message in a data structure configured to store a plurality of timeout request messages; and upon determining that the timeout period has elapsed and that the first thread is still requesting access to the shared resource, sending a wakeup message to a message queue associated with the indefinitely blocked thread. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A system, comprising:
-
a processor; and a memory containing a program, which when executed by the processor is configured to perform the steps of; sending, by a first thread, a timeout request message to a timeout handler process; transitioning the first thread to an indefinitely blocked state; determining, from the timeout request message, a timeout period after which the first thread should be unblocked from the indefinitely blocked state while waiting to access to the shared resource; storing the timeout request message in a data structure configured to store a plurality of timeout request messages; and upon determining that the timeout period has elapsed and that the first thread is still requesting access to the shared resource, sending a wakeup message to a message queue associated with the indefinitely blocked thread. - View Dependent Claims (20)
-
Specification