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.
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.
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.