ch4 - Chapter 4: Threads Chapter Adapted to COP4610 by...

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

View Full Document Right Arrow Icon
Chapter 4: Threads Chapter 4: Threads Adapted to COP4610 by Robert van Engelen
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 – 7 th edition, Jan 23, 2005 Process Versus Thread Process Versus Thread A process has its own address space, file descriptors of open files and devices, and other resources fork () duplicates the process A single process can have a single thread of control or multiple threads A new thread can be started at any time Each thread shares the same data, file descriptors, and code of the process A thread has its own registers, stack (for function calls), and program counter
Background image of page 2
4.3 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Single and Multithreaded Processes Single and Multithreaded Processes
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 – 7 th edition, Jan 23, 2005 Benefits Benefits Benefits of multi-threading Responsiveness (e.g. main thread executes while another waits for I/O) Resource sharing Economy (threads are cheap compared to processes) Utilization of MP architectures For example, one thread of a Web browser renders the content of a page while another downloads data
Background image of page 4
4.5 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 User Threads User Threads Thread management done by user-level threads library Three primary thread libraries: POSIX Pthreads Win32 threads Java threads
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 – 7 th edition, Jan 23, 2005 Kernel Threads Kernel Threads Supported by the Kernel Examples Windows XP/2000 Solaris Linux Tru64 UNIX Mac OS X
Background image of page 6
4.7 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Multithreading Models Multithreading Models Many-to-One One-to-One Many-to-Many
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 – 7 th edition, Jan 23, 2005 Many-to-One Many-to-One Many user-level threads mapped to single kernel thread Examples: Solaris Green Threads GNU Portable Threads
Background image of page 8
4.9 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 One-to-One One-to-One Each user-level thread maps to kernel thread Examples Windows NT/XP/2000 Linux Solaris 9 and later
Background image of page 9

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

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

This note was uploaded on 10/11/2011 for the course COP 4610 taught by Professor Robertengelen during the Spring '11 term at FSU.

Page1 / 26

ch4 - Chapter 4: Threads Chapter Adapted to COP4610 by...

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

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