Holding and Releasing Processes and Threads

As an alternative to synchronizing execution automatically by setting a barrier point, you can synchronize execution manually by using a hold command.

When a process or a thread is held, it ignores any command to resume executing. For example, if you placed a hold on a single process in a control group that contained three processes, selecting Group > Go resumes executing only the two unheld processes in the group. The held process ignores the Go command.

Manually holding and releasing processes and threads is useful in the following situations:

When you need to run only a subset of the processes and threads, you can manually hold all others and allow to run only the ones you want.

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, you can manually release the specific process or thread and then run it.

See Barrier Points for more information on holding and releasing barrier breakpoints.

If a process or a thread is running when you set or release a hold, TotalView stops the process or thread and then holds it. TotalView lets you hold and release processes independently from threads.

Holding a Process

To place or release a hold on a process, double-click the process in the Processes & Threads view to select it, and then toggle the menu item Process > Hold.

Alternatively, to place or release a hold on the group of processes to which the selected process belongs, select Group > Hold or Group > Release, respectively.

Group > Hold holds all processes that are part of the same control group associated with the current thread in focus. And Group > Release releases all processes that were held in the control group.

The Group > Hold and Group > Release menu selections are a convenience. Consider a scenario where you have placed individual holds on a large number of processes and now want to release them. It is more convenient to use Group > Release than to individually release each held process. Similarly, when a control group contains many processes and you want to execute only a small number of those processes, it is quicker to use Group > Hold and then release only those processes that you want to execute.

If you hold a process and then select Process > Go, a warning alerts you that you first need to remove the hold on the process before running it.

Viewing the Hold Status

You can observe the hold status of a process in TotalView's Processes & Threads view in both the tree view () and the tabular view (), as shown in Figure 117 and Figure 118, respectively.

Figure 117. Process status in the Processes & Threads view, Tree view

Figure 118. Process status in the Processes & Threads view, Tabular view

You can also observe the hold status for a selected process in TotalView's title and status bar.

Placing and Releasing Holds Using CLI Commands

You can use the following CLI commands to hold and release a process.

dhold -process
dunhold -process

Holding a Thread

To place or release a hold on a thread, double-click the thread in the Processes & Threads view to select it, and then toggle the menu item Thread > Hold.

Alternatively, to place or release a hold on all threads in the process to which the selected thread belongs, select Process > Hold Threads or Process > Release Threads, respectively. Process > Hold Threads holds all threads that are part of the same process associated with the current thread in focus. And Process > Release Threads releases all threads that were held in the process.

The Process > Hold Threads and Process > Release Threads menu selections are a convenience. Consider a scenario where you have placed individual holds on a large number of threads and now want to release them. It is more convenient to use Process > Release Threads than to individually release each held thread. Similarly, when a process contains many threads and you want to execute only a small number of those threads, it is quicker to use Process > Hold Threads and then release only those threads that you want to execute.

If you hold a thread and then select Thread > Go, a warning alerts you that you first need to remove the hold on the thread before running it.

Viewing the Hold Status

You can observe the hold status of a thread in TotalView's Processes & Threads view in both the tree view () and the tabular view (), as shown in Figure 119 and Figure 120, respectively.

Figure 119. Thread status in the Processes & Threads view, Tree view

Figure 120. Thread status in the Processes & Threads view, Tabular view

You can also observe the hold status for a selected thread in TotalView's title and status bar.

Placing and Releasing Holds Using CLI Commands

You can use the following CLI commands to hold and release a thread.

dhold -thread
dunhold -thread

Related Topics

Barrier Points

dhold

dunhold

The Processes & Threads View