Threads
The operating system owns the daemon programs discussed in the previous section A Couple of Processes. These daemons perform a variety of activities, from managing computer resources to providing standard services such as printing.
While operating systems can have many independently executing components, a program can as well, accomplished in various ways. One programming model splits the work off into somewhat independent tasks within the same process. This is the threads model.
Figure 197 also shows the daemon processes that are executing. (The figures in the rest of this chapter won’t show these daemons.)
Figure 197, Threads
In this computing model, a program (the main thread) creates threads. If they need to, these newly created threads can also create threads. Each thread executes relatively independently from other threads. You can, of course, program them to share data and to synchronize how they execute.
The debugging issue here is similar to the problem of processes running on different machines. In both, a debugger must intervene with more than one executing entity, having to understand multiple address spaces and multiple contexts.
NOTE: Little difference exists between a multi-threaded or a multi-process program when using TotalView. The way in which TotalView displays process information is very similar to how it displays thread information.
 
RELATED TOPICS 
 
TotalView’s design on organizing groups, processes, and threads
Debugging multi-threaded, multi-process programs
Setting breakpoints
Barrier points in multi-threaded programs