★ Hybrid Implementation ¥ 斗 ★★ o User-level threads are managed by runtime systems o Kernel-level threads are managed by os o Multiplexing user-level threads onto kernel-level threads
36 Hybrid Implementation User-level threads are managed by runtime systems Kernel-level threads are managed by OS Multiplexing user-level threads onto kernel- level threads
★ Hybrid Implementation ¥ 斗 ★★ Multiple user threads on a kernel thread space erne Kern Kernel thread space 7
37 Hybrid Implementation
★ Multiple Threads ¥ 斗 ★★ o Can have several threads in a single address space That is what thread is invented for o Play analogy: several actors on a single set Sometimes interact (e.g. dance together) Sometimes do independent tasks
38 Multiple Threads Can have several threads in a single address space – That is what thread is invented for Play analogy: several actors on a single set – Sometimes interact (e.g. dance together) – Sometimes do independent tasks
★ Multiple Threads ¥ 斗 ★★ o Private state for a thread vs. global state shared between threads What private state must a thread have? other state is shared between all threads in a process
39 Multiple Threads Private state for a thread vs. global state shared between threads – What private state must a thread have? – Other state is shared between all threads in a process
★ Multiple Threads ¥ 斗 ★★ Per process items Per thread items Address space Program counter Global variables Registers Open files Stack Child processes State Pending alarms Signals and signal handlers Accounting information
40 Multiple Threads Per process items Per thread items Address space Program counter Global variables Registers Open files Stack Child processes State Pending alarms Signals and signal handlers Accounting information