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.