Process and implementation for interrupting locked threads
OwnerBret Patterson, John Rowland +1inventors
InventorsBret Patterson, John Rowland, Kirk Sexton
Life of this patent
Estimating the term…
Abstract
A thread monitor identifies and interrupts locked threads. A byte code insertion tool inserts timers around classes that are bound to threads. Timers may also be inserted around particular portions of code. When a portion of code, such as a thread, a loop, or a condition block, for example, to be monitored begins, a call is made to a thread monitor to start a timer. If the portion of code ends normally, the timer is removed. If the timer expires, then the thread monitor may interrupt the thread or send a notification to a user so that appropriate action may be taken.
Claims21
A method, in a data processing system, for managing an application thread, the method comprising:
- analyzing a portion of code bound to an application thread to identify candidate code that is a candidate to result in a locked condition;
- inserting first instructions to start a timer and second instructions to remove the timer around the candidate code;
- executing the first instructions to notify a thread monitor to start the timer;
- and
- if the candidate code completes execution without locking, executing the second instructions to notify the thread monitor to remove the timer.
A method, in a data processing system, for monitoring threads, the method comprising:
- receiving, from an application thread, notification to start a timer;
- associating the timer with the application thread;
- responsive to expiration of the timer, taking an action.
A computer program product, in a computer readable medium, for managing an application thread, the computer program product comprising:
- instructions for analyzing a portion of code bound to an application thread to identify candidate code that is a candidate to result in a locked condition;
- instructions for inserting first instructions to start a timer and second instructions to remove the timer around the candidate code;
- instructions for executing the first instructions to notify a thread monitor to start the timer;
- and
- instructions for executing the second instructions to notify the thread monitor to remove the timer if the candidate code completes execution without locking.
A computer program product, in a computer readable medium, for monitoring threads, the computer program product comprising:
- instructions for receiving, from an application thread, notification to start a timer;
- instructions for associating the timer with the application thread;
- instructions for taking an action responsive to expiration of the timer.
An apparatus, in a data processing system, for managing an application thread, the apparatus comprising:
- a virtual machine;
- an application thread running in the virtual machine;
- a thread monitor running in the virtual machine;
- and
- a byte code insertion tool, wherein the byte code insertion tool analyzes a portion of code bound to the application thread to identify candidate code that is a candidate to result in a locked condition and inserts first instructions to start a timer and second instructions to remove the timer around the candidate code;
- wherein the virtual machine executes the first instructions to notify a thread monitor to start the timer and wherein the virtual machine executes the second instructions to notify the thread monitor to remove the timer if the candidate code completes execution without locking.
Dependencies are inferred from the claim text.