Lecture4 - Chapter 4: Threads Operating System Concepts 8th...

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

View Full Document Right Arrow Icon
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads
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 ©2009 Operating System Concepts – 8 th Edition Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Solaris Linux Threads
Background image of page 2
4.3 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Objectives To introduce the notion of a thread — a fundamental unit of CPU utilization that forms the basis of multithreaded computer systems To discuss the APIs for the Pthreads, Win32, and Java thread libraries To examine issues related to multithreaded programming
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 ©2009 Operating System Concepts – 8 th Edition Processes and Threads Processes have two characteristics: Resource ownership - process includes a virtual address space to hold the process image Scheduling/execution - follows an execution path that may be interleaved with other processes These two characteristics are treated independently by an operating system
Background image of page 4
4.5 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process The resource ownership is referred to as the process or task Has program, data, PCB, shared variables, process image, etc
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 ©2009 Operating System Concepts – 8 th Edition Threads Scheduling is referred to as a thread or lightweight process
Background image of page 6
4.7 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Threads in Process Each thread has An execution state (running, ready, etc.) Saved thread context when not running An execution stack Some per-thread static storage for local variables Access to the memory and resources of its process (all threads of a process share this) One way to view a thread is as an independent program counter operating within a process .
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 ©2009 Operating System Concepts – 8 th Edition Traditional approach Single thread of execution per process Concept of thread not recognized independently This is the single-threaded approach
Background image of page 8
4.9 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Multithreading The ability of an OS to support multiple, concurrent paths of execution within a single process .
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 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Benefits of Threads Takes less time to create a new thread than a process Less time to terminate a thread than a process Switching between two threads takes less time that switching processes Threads can communicate with each other without invoking the kernel No need for shared memory or message passing
Background image of page 10
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Example: Remote Procedure Call Consider: A program that performs two remote
Background image of page 11

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

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

Page1 / 67

Lecture4 - Chapter 4: Threads Operating System Concepts 8th...

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

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