
CS 414 : Operating Systems
UNIVERSITY OF VIRGINIA
Department of Computer Science
Fall 2005
Topic 7: Threads and Messages
๎
Threads
๎
Each process has a) PC, stack, address space and b) single thread of control
๎
Is it desirable to have multiple threads of control that share a single address space?
๎
Example: file server and database server
๎
Threads are like "mini" processes (called light-weight processes); each thread has its
own PC and stack, and runds strictly sequentially.
๎
Different threads are not as independent as different processes. Why?
๎
What threads offer?
๎
responsiveness via parallelism: respond while performing other tasks
๎
retaining the idea of sequential processes using blocking system calls
๎
efficient: fast thread creation and reduced context switching overhead
๎
easy software development (coordinating processes)
๎
sharing: easy to share data
๎
User threads vs kernel threads
โ 7.1 โ