This preview shows page 1. Sign up to view the full content.
Unformatted text preview: inter Process ID (PID) Figure 11.2: Alternative view of a process. The interesting point about Figure 11.2 is that it treats the process as an execution unit with a very small amount of state that runs in the context of a much larger amount of state. Given this view, we can now extend our notion of process to include multiple threads that share the same code, data, and kernel context, as shown in Figure 11.3. Each thread associated with a process has its own stack, registers, condition codes, stack pointer, and program counter. Since there are now multiple threads, we will also add an integer thread ID (TID) to each thread context. The execution model for multiple threads is similar in some ways to the execution model for multiple processes. Consider the example in Figure 11.4. Each process begins life as a single thread called the main thread. At some point, the main thread creates a peer thread and from this point in time the two threads run concurrently (i.e., their logical ﬂows overlap in time). Eventually, control passes to the peer thread via a 11.1. BASIC THREAD CONCEPTS
Thread 1 s...
View Full Document
- Spring '10
- The American