Detecting the starting and ending of a task when thread pooling is employed
First Claim
1. A method for detecting a selected task starting and ending when thread pooling is employed, comprising:
- profiling inter-thread communication, by monitoring one or more first threads performing a wait operation on a given object and by monitoring one or more second threads performing a notify operation and/or a notify-all operation on the given object;
constructing a labeled directed graph based on the inter-thread communication that has been profiled,the labeled directed graph comprising a plurality of nodes and one or more directed edges, each node corresponding to one of the first and the second threads, each directed edge having a label, each directed edge connecting a first node and a second node, each directed edge corresponding to performance of one of the wait operation and the notify operation and/or the notify-all operation, where an identifier of the given object serves as a label of each of one or more of the directed edges;
selecting a set of nodes of the labeled directed graph that each has a directed edge thereto having a same label;
employing the threads to which the nodes of the set of nodes correspond as a plurality of worker threads of a thread pool in relation to which thread pooling is employed for completing tasks including the selected task;
employing the threads to which the nodes that are connected to the nodes of the set of nodes correspond as one or more master threads in relation to which thread pooling is employed for completing the tasks, where the master threads select an available worker thread of the thread pool when one of the tasks is to be completed; and
,employing an object having an identifier serving as the same label of the directed edges to the set of nodes as a pool monitoring mechanism,wherein the pool monitoring mechanism detects starting of the selected task by detecting when the master threads select one of the worker threads to perform the selected task by performing the notify operation and/or the notify-all operation,and wherein the pool monitoring mechanism detects ending of the selected task by detecting when the one of the worker threads performs the wait operation.
1 Assignment
0 Petitions
Accused Products
Abstract
Starting and ending of a task is detected, where thread pooling is employed. Threads perform a wait operation on a given object are monitored, and threads performing a notify/notify-all operation on the given object are monitored. A labeled directed graph is constructed. Each node of the graph corresponds to one of the threads. Each edge of the graph has a label and corresponds to performance of the wait or notify/notify-all operation. An identifier of the given object is a label of a number of the edges. A set of nodes is selected that each has an edge having the same label. The threads of these nodes are worker threads of a thread pool. The threads of the nodes that are connected to the set of nodes are master threads. An object having an identifier serving as the label of the edges to the set of nodes is a monitoring mechanism.
-
Citations
19 Claims
-
1. A method for detecting a selected task starting and ending when thread pooling is employed, comprising:
-
profiling inter-thread communication, by monitoring one or more first threads performing a wait operation on a given object and by monitoring one or more second threads performing a notify operation and/or a notify-all operation on the given object; constructing a labeled directed graph based on the inter-thread communication that has been profiled, the labeled directed graph comprising a plurality of nodes and one or more directed edges, each node corresponding to one of the first and the second threads, each directed edge having a label, each directed edge connecting a first node and a second node, each directed edge corresponding to performance of one of the wait operation and the notify operation and/or the notify-all operation, where an identifier of the given object serves as a label of each of one or more of the directed edges; selecting a set of nodes of the labeled directed graph that each has a directed edge thereto having a same label; employing the threads to which the nodes of the set of nodes correspond as a plurality of worker threads of a thread pool in relation to which thread pooling is employed for completing tasks including the selected task; employing the threads to which the nodes that are connected to the nodes of the set of nodes correspond as one or more master threads in relation to which thread pooling is employed for completing the tasks, where the master threads select an available worker thread of the thread pool when one of the tasks is to be completed; and
,employing an object having an identifier serving as the same label of the directed edges to the set of nodes as a pool monitoring mechanism, wherein the pool monitoring mechanism detects starting of the selected task by detecting when the master threads select one of the worker threads to perform the selected task by performing the notify operation and/or the notify-all operation, and wherein the pool monitoring mechanism detects ending of the selected task by detecting when the one of the worker threads performs the wait operation. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A method for detecting a selected task starting and ending when thread pooling is employed, comprising:
-
detecting starting of the selected task by detecting when a master thread selects an existing available worker thread within a pool of existing available worker threads by the master thread performing a notify-operation and/or a notify-all operation, where the existing available worker thread selected completes the selected task; detecting ending of the selected task by the existing available worker thread selected by detecting when the existing available worker thread performs a wait operation. - View Dependent Claims (12, 13, 14, 15)
-
-
16. An article of manufacture comprising:
-
a tangible computer-readable medium; and
,means in the medium for; profiling inter-thread communication, by monitoring one or more first threads performing a wait operation on a given object and by monitoring one or more second threads performing a notify operation and/or a notify-all operation on the given object; constructing a labeled directed graph based on the inter-thread communication that has been profiled, wherein the labeled directed graph comprises a plurality of nodes and one or more directed edges, each node corresponding to one of the first and the second threads, each directed edge having a label, each directed edge connecting a first node and a second node, each directed edge corresponding to performance of one of the wait operation and the notify operation and/or the notify-all operation, where an identifier of the given object serves as a label of each of one or more of the directed edges. - View Dependent Claims (17, 18, 19)
-
Specification