Tirgul 4 Flashcards
Do threads share a heap?
Yes
Do threads share a stack?
No, every thread has its own stack
In kernel level threads, where are the thread descriptors stored?
In the PCB. The PCB has holds pointers to all of the thread descriptions that the process has.
In user level threads, where are the thread descriptors stored?
Inside the heap.
Processes vs. Kernel Threads vs. User Threads:
Interactions between instances
Processes: protected from each other, require the OS to communicate
Kernel and User Threads: Share address space, simple communication
Processes vs. Kernel Threads vs. User Threads:
Context switch overhead
Processes: High overhead, since all operations require a kernel trap, significant work.
Kernel Threads: medium overhead. Operations require kernel trap but little work.
User Threads: Low overhead, everything is done at user level