TotalView User Guide : Part V: Debugging : Debugging Programs : Manipulating Processes and Threads : Holding and Releasing Processes and Threads

Holding and Releasing Processes and Threads
Many times when you are running a multi-process or multi-threaded program, you want to synchronize execution to the same place. You can do this manually using a hold command, or automatically by setting a barrier point.
When a process or a thread is held, it ignores any command to resume executing. For example, assume that you place a hold on a process in a control group that contains three processes. If you select Group > Go, two of the three processes resume executing. The held process ignores the Go command.
Use the Release command to remove the hold. When you release a process or a thread, it can resume execution, but you still need to tell it to do so. This is, you must resume execution with a command such as Go, Out, or Step.
Manually holding and releasing processes and threads is useful in the following instances:
*
*
When a process or thread is held at a barrier point and you want to run it without first running all the other processes or threads in the group to that barrier. In this case, you release the process or the thread manually and then run it.
See Setting Barrier Points” for more information on manually holding and releasing barrier breakpoints.
When TotalView is holding a process, the Root and Process Windows display a held indicator, which is the uppercase letter H. When TotalView is holding a thread, it displays a lowercase h.
You can hold or release a thread, process, or group of processes in one of the following ways:
*
*
*
*
If a process or a thread is running when you use a hold or release command, TotalView stops the process or thread and then holds it. TotalView lets you hold and release processes independently from threads.
The Process pulldown menu contains the commands Hold Threads and Release Threads, which act on all the threads in a multi-process program. The result is seldom what you actually want as you really do want something to run. You can select one or more threads and use the Thread > Hold toggle command to clear them so that TotalView lets them run. This may appear awkward, but it is actually an easy way to run just one or more threads when your program has a lot of threads. You can verify that you’re doing the right thing by looking at the thread status in the Root Window.
The following set of drawings presents examples of using hold commands:
This figure shows a process with three threads. Before you do anything, all threads in the process can be run.
Select the Process > Hold toggle. The blue shading indicates that you held the process.
Go to the Threads menu. The button next to the Hold command isn’t selected. This is because the thread hold state is independent from the process hold state.
Select it. The circle indicates that thread 1 is held. At this time, there are two different holds on thread 1. One is at the process level; the other is at thread level.
Select the Process > Hold command.
Select Process > Go. The second and third threads run.
Select Process > Release Threads. This releases the hold placed on the first thread by the Thread > Hold command. You could also release the thread individually with Thread > Hold.
When you select Process > Go, all threads run.

Rogue Wave Software, Inc.
Voice: (303) 473-9118
rwonlinedocs@roguewave.com