Chapter 4: Threads... 4.3 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005Single and Multithreaded Processes... 4.18 Silberschatz, Galvin and G
Trang 1Chapter 4: Threads
Trang 24.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Trang 34.3 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Single and Multithreaded Processes
Trang 44.4 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Trang 54.5 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
User Threads
Trang 64.6 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Trang 74.7 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Multithreading Models
Trang 84.8 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Many-to-One
Trang 94.9 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Many-to-One Model
Trang 104.10 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Trang 114.11 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
One-to-one Model
Trang 124.12 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Trang 134.13 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Many-to-Many Model
Trang 144.14 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Two-level Model
bound to kernel thread
Trang 154.15 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Two-level Model
Trang 164.16 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Trang 174.17 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Semantics of fork() and exec()
Trang 184.18 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Thread Cancellation
thread immediately
periodically check if it should be cancelled
Trang 194.19 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Signal Handling
particular event has occurred
Trang 204.20 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Thread Pools
thread than create a new thread
bound to the size of the pool
Trang 214.21 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Thread Specific Data
creation process (i.e., when using a thread pool)
Trang 224.22 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Scheduler Activations
maintain the appropriate number of kernel threads allocated
to the application
mechanism from the kernel to the thread library
correct number kernel threads
Trang 234.23 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Pthreads
creation and synchronization
implementation is up to development of the library
Mac OS X)
Trang 244.24 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Windows XP Threads
as the context of the threads
Trang 254.25 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Linux Threads
of the parent task (process)
Trang 264.26 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Java Threads
Trang 274.27 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005
Java Thread States
Trang 28End of Chapter 4