This preview shows page 1. Sign up to view the full content.
Unformatted text preview: e and data areas. The threads also share the same set of open ﬁles and the same set of installed signal handlers. In an operational sense, it is impossible for one thread to read or write the register values of another thread. On the other hand, any thread can access any location in the shared virtual memory. If some thread modiﬁes a memory location, then every other thread will eventually see the change if it reads that location. Thus, registers are never shared, while virtual memory is always shared. The memory model for the separate thread stacks is not as clean. These stacks are contained in the stack area of the virtual address space, and are usually accessed independently by their respective threads. We say usually rather than always, because different thread stacks are not protected from other threads. So if a thread somehow manages to acquire a pointer to another thread’s stack, then it can read and write any part of that stack. Our example program shows an example of this in line 29, where the peer thread...
View Full Document
- Spring '10
- The American