Understanding Multithreaded Programs

While the way in which operating systems implement threads vary, most share the following characteristics:

  • Shared address space

    The threads share an address space (memory) with other threads. They can read and write the same variables and can execute the same code.

  • Private execution context

    Each thread has its own general-purpose and floating-point registers.

  • Thread private data

    Some operating systems allow a program to declare thread private data. This declaration provides each thread with its own copy of the variable. Changes made by one thread to its private variables are not seen by other threads.

  • Private execution stack

    Each thread has an address space reserved for its execution stack. However, one thread's stack can be read and written by other threads sharing the address space.

TotalView can help you debug threaded applications on a variety of operating systems. On some of these systems, a process consists of an address space and a list of one or more threads. Other operating systems implement tasks or threads running in the computer's memory space and do not support multiple processes or address spaces on a single machine.

Because the ways operating systems handle threads differ, TotalView implements a general model of address spaces and execution contexts. A TotalView thread refers to a thread or task with an execution context, and process refers to an address space or computer memory that can run one or more threads.

 
 
 
 
support@etnus.com
Copyright © 2001, Etnus, LLC. All rights reserved.
Version 5.0