Chapter-02

Chapter-02 - Chapter 2 Processes and Threads 2.1 Processes...

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

View Full Document Right Arrow Icon
1 Processes and Threads Chapter 2 2.1 Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Agenda 2.1 Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling
Background image of page 2
3 Process The most central concept in any OS An abstraction of a running program Modern Computers Can do more than one thing at the same time Can run user programs Can read disk and work with user terminal In a multiprogramming system More than one user program can be scheduled Each may run for tens of msecs.
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 Processes The Process Model Multiprogramming of four programs Conceptual model of 4 independent, sequential processes Only one program active at any instant
Background image of page 4
5 Process Creation Principal events that cause process creation 1. System initialization 2. Execution of a process creation system 3. User request to create a new process 4. Initiation of a batch job
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Process Termination Conditions which terminate processes 1. Normal exit (voluntary) 2. Error exit (voluntary) 3. Fatal error (involuntary) 4. Killed by another process (involuntary)
Background image of page 6
7 Process Hierarchies Parent creates a child process, child processes can create its own process Forms a hierarchy UNIX calls this a "process group" Windows has no concept of process hierarchy all processes are created equal
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Process States (1) Possible process states running blocked ready Transitions between states shown
Background image of page 8
9 Process States (2) Lowest layer of process-structured OS handles interrupts, scheduling Above that layer are sequential processes
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 Implementation of Processes (1) Fields of a process table entry
Background image of page 10
11 Implementation of Processes (2) Skeleton of what lowest level of OS does when an interrupt occurs
Background image of page 11

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

View Full DocumentRight Arrow Icon
12 Agenda 2.1 Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling
Background image of page 12
13 Threads In traditional OS, each process has An address space A single tread of control In modern OS, each process may have Multiple threads of control Same address spare Running in quasi-parallel Thread or a Lightweight Process has a program counter, registers, stack
Background image of page 13

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

View Full DocumentRight Arrow Icon
14 Threads The Thread Model (1) (a) Three processes each with one thread (b) One process with three threads
Background image of page 14
15 The Thread Model (2) Items shared by all threads in a process Items private to each thread
Background image of page 15

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

View Full DocumentRight Arrow Icon
16 The Thread Model (3) Each thread has its own stack
Background image of page 16
17 Thread Usage (1) A word processor with three threads
Background image of page 17

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

View Full DocumentRight Arrow Icon
18 Thread Usage (2) A multithreaded Web server
Background image of page 18
19 Thread Usage (3) Rough outline of code for previous slide (a) Dispatcher thread (b) Worker thread
Background image of page 19

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

View Full DocumentRight Arrow Icon
20 Thread Usage (4) Three ways to construct a server
Background image of page 20
21 Implementing Threads in User Space A user-level threads package
Background image of page 21

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

View Full DocumentRight Arrow Icon
22 Implementing Threads in the Kernel A threads package managed by the kernel
Background image of page 22
23 Hybrid Implementations Multiplexing user-level threads onto kernel- level threads
Background image of page 23

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

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

This note was uploaded on 09/15/2011 for the course CDA 4610 taught by Professor Sadjadi during the Fall '09 term at FIU.

Page1 / 67

Chapter-02 - Chapter 2 Processes and Threads 2.1 Processes...

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

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