Chapter_4

Chapter_4 - Chapter 4: Threads s Overview q q q q q q...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
4.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 4: Threads Chapter 4: Threads Overview Multithreading Models Threading Issues Windows XP Threads Linux Threads Java Threads Pthreads
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Single and Multithreaded Processes Single and Multithreaded Processes
Background image of page 2
4.3 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Benefits Benefits Responsiveness: Multithreading an interactive application increases responsiveness to the user. Resource Sharing: Threads share memory and resources of the processes to which they belong. Economy: Process creation is expensive; In Solaris 2, creating a process is 30 times slower than creating a thread and context switching is five times slower Utilization of MP Architectures: Benefits of multithreading increase in multiprocessor systems because different threads can be scheduled to different processors
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4.4 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts User Threads User Threads Thread management done by user-level threads library: The library provides support for thread creation, scheduling, and management. Three primary thread libraries: POSIX Pthreads Win32 threads Java threads
Background image of page 4
4.5 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Kernel Threads Kernel Threads Supported by the Kernel directly. Kernel performs the thread creation, scheduling and management inside the kernel Examples Windows XP/2000 Solaris Linux Tru64 UNIX Mac OS X
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4.6 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Multithreading Models Multithreading Models Many systems provide support for both user-level and kernel level threads. This provides different multithreading models Many-to-One: maps many user level threads into one kernel level thread. The entire process will block if a thread makes a blocking system call Since only one thread can access kernel at a time, multiple threads cannot run concurrently and thus cannot make use of multiprocessors One-to-One: maps each user level thread to a kernel level thread Creating a user level thread results in creating a kernel thread More overhead and allows parallelism Because of the overhead most implementations limit the number of kernel threads created Many-to-Many: Multiplexes many user level threads to a smaller or equal number of kernel threads Has the advantages of both the many-to-one and one-to-one model Solaris2, IRIS, HP-UX takes this approach
Background image of page 6
4.7 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Many-to-One Model Many-to-One Model
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4.8 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts One-to-one Model One-to-one Model
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 12/14/2010.

Page1 / 20

Chapter_4 - Chapter 4: Threads s Overview q q q q q q...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online