Organizing processes, threads, and their stacks – user and kernel space
The traditional UNIX process model – Everything is a process; if it’s not a process, it’s a file – has a lot going for it. The very fact that it is still the model followed by operating systems after a span of over five decades amply validates this. Of course, nowadays, the thread is considered the atomic execution context; a thread is an execution path within a process. Threads share all process resources, including the user VAS, open files, signal dispositions, IPC objects, credentials, paging tables, and so on, except for the stack. Every thread has its own private stack region (this makes perfect sense; if not, how could threads truly run in parallel, as it’s the stack that holds execution context).
The other reason we focus on the thread and not the process is made clearer in Chapter 10, The CPU Scheduler – Part 1. For now, we shall just say this: the thread...