★ Kernel-Level Implementation ¥ 斗 ★★ Process Thread Kernel Process Thread table table
26 Kernel-Level Implementation
★ Kernel-Level Implementation ¥ 斗 ★★ o Advantage: Easier to programming Blocking threads does not block process s Problems. Costly: need to trap into oS to switch threads OS space is limited (for maintaining info) Need to modifying OS!
27 Kernel-Level Implementation Advantage: – Easier to programming – Blocking threads does not block process Problems: – Costly: need to trap into OS to switch threads – OS space is limited (for maintaining info) – Need to modifying OS!
★ User-Level Implementation ¥ 斗 ★★ o Completely implemented in user space o A run-time system acts as a scheduler o Threads voluntarily cooperate i.e. yield control to other threads o OS need not know existence of threads
28 User-Level Implementation Completely implemented in user space A run-time system acts as a scheduler Threads voluntarily cooperate – i.e. yield control to other threads OS need not know existence of threads
★ User-Level Implementation ¥ 斗 ★★ P rocess Thread User space Kerne space Kernel Run-time Thread Process system table table
29 User-Level Implementation
★ User-Level Implementation ¥ 斗 ★★ o Advantage: Flexible, can be implemented on any os Faster no need to trap into OS s Problems. Programming is tricky blocking threads block process
30 User-Level Implementation Advantage: – Flexible, can be implemented on any OS – Faster: no need to trap into OS Problems: – Programming is tricky – blocking threads block process!