TotalView places processes and threads in groups as your program creates them, except for the lockstep groups that are created or changed whenever a process or thread hits an action point or is stopped for any reason. There are many ways to build this type of organization. The following steps indicate how TotalView might do this.
Figure 28: Step 1: A Program Starts
Control group: The program is loaded and creates a group.
Share group: The program begins executing and creates a group.
Workers group: The thread in the main() routine is the workers group.
Lockstep group: There is no lockstep group because the thread is running. (Lockstep groups contain only stopped threads.)
Figure 29: Step 2: A Thread is Started
Control group: The control group is unchanged.
Share group: The share group is unchanged.
Workers group: TotalView adds the thread to the existing group.
Lockstep group: There are no lockstep groups because the threads are running.
Figure 30: Step 3: Creating a Process using exec()
Control group: The group is unchanged.
Share group: TotalView creates a second share group with the process created by the exec() function as a member. TotalView removes this process from the first share group.
Workers group: Both threads are in the workers group.
Lockstep group: There are no lockstep groups because the threads are running.
Control group: The group is unchanged.
Share group: The groups are unchanged.
Workers group: The group is unchanged.
Lockstep group: TotalView creates a lockstep group whose member is the thread of the current process. (In this example, each thread is its own lockstep group.)The program is continued and TotalView starts a second version of your program from the shell. You attach to it within TotalView and put it in the same control group as your first process.
Figure 31: Step 5: Creating a Second Version
Control group: TotalView adds a third process.
Share group: TotalView adds this third process to the first share group.
Workers group: TotalView adds the thread in the third process to the group.
Lockstep group: There are no lockstep groups because the threads are running.
Figure 32: Step 6: Creating a Remote Process
Control group: TotalView extends the control group so that it contains the fourth process, which is running on the second computer.
Share group: The first share group now contains this newly created process, even though it is running on the second computer.
Workers group: TotalView adds the thread within this fourth process to the workers group.
Lockstep group: There are no lockstep groups because the threads are running.A process within the control group creates a thread. This adds a second thread to one of the processes.
Figure 33: Step 7: Creating a Thread
Control group: The group is unchanged.
Share group: The group is unchanged.
Workers group: TotalView adds a fifth thread to this group.
Lockstep group: There are no lockstep groups because the threads are running.A breakpoint is set on a line in a process executing in the first share group. By default, TotalView shares the breakpoint. The program executes until all three processes are at the breakpoint.
Figure 34: Step 8: Hitting a Breakpoint
Control group: The group is unchanged.
Share group: The groups are unchanged.
Workers group: The group is unchanged.
Lockstep groups: TotalView creates a lockstep group whose members are the four threads in the first share group.
Figure 35: Step 9: Stepping the Lockstep Group
Control group: The group is unchanged.
Share group: The groups are unchanged.
Workers group: The group is unchanged.
Lockstep group: The lockstep groups are unchanged. (There are other lockstep groups as explained in Chapter 13, “Using Groups, Processes, and Threads”.)What Comes NextThis example could continue to create a more complicated system of processes and threads. However, adding more processes and threads would not change the described behavior.
Rogue Wave Software, Inc. |
Voice: (303) 473-9118 |
rwonlinedocs@roguewave.com |