Processes and Threads - PowerPoint PPT Presentation

About This Presentation
Title:

Processes and Threads

Description:

Execution of a process creation system. User request to create a new process ... Transitions between states shown. Conceptualizing Process States ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 23
Provided by: kna4
Category:

less

Transcript and Presenter's Notes

Title: Processes and Threads


1
Processes and Threads
  • Ch 2.1 and 2.2
  • Tuesday, January 23s, 2007

2
Todays Schedule
  • Return HW 1 and Quiz 1
  • Sec 1.7 - O/S Stuctures
  • Sec 2.1 Processes
  • Sec 2.2 - Threads

3
Approaches to OS
  • Monolithic
  • Virtual Machines
  • Client-Server (microkernel)

4
Monolithic OS Architecture
  • OS written as a set of procedures
  • Each procedure has well-defined interface
    (parameters)
  • Very little structure or information hiding

5
Virtual Machine OS Architecture
  • Replicate the hardware within software
  • Trap OS calls and translate/handle them
  • Breaks down if you make direct I/O calls
  • Slow(Windows running DOS applications)
  • Other approach JVM (define an alternate
    instruction set and translate to various OS)

6
Client-Server OS Architecture
  • Implement as much as possible in user-level
    modules
  • The OS is as small as possible
  • It only serves to translate and message pass
    OS-level calls to service processes

7
Processes - The Process Model
  • Multiprogramming of four programs
  • Conceptual model of 4 independent, sequential
    processes
  • Only one program active at any instant

8
Process Creation
  • Principal events that cause process creation
  • System initialization
  • Execution of a process creation system
  • User request to create a new process
  • Initiation of a batch job

9
Process Termination
  • Conditions which terminate processes
  • Normal exit (voluntary)
  • Error exit (voluntary)
  • Fatal error (involuntary)
  • Killed by another process (involuntary)

10
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

11
Process States
  • Possible process states
  • running
  • blocked
  • ready
  • Transitions between states shown

12
Conceptualizing Process States
  • Lowest layer of process-structured OS
  • handles interrupts, scheduling
  • Above that layer are sequential processes

13
Process table entry Items
  • Fields of a process table entry

14
The Thread Model
  • (a) Three processes each with one thread
  • (b) One process with three threads

15
Process vs. Thread Items
  • Items shared by all threads in a process
  • Items private to each thread

16
The Thread Model (3)
  • Each thread has its own stack

17
Thread Usage
  • A word processor with three threads

18
Thread Usage (2)
  • A multithreaded Web server

19
Thread Usage (3)
  • Rough outline of code for previous slide
  • (a) Dispatcher thread
  • (b) Worker thread

20
Implementing Threads in User Space
  • A user-level threads package

21
Implementing Threads in the Kernel
  • A threads package managed by the kernel

22
Tuesday, January 23
  • Read part of Chapter 2.3 Interprocess
    Communication pages 100 - 106
  • Do not worry about code fragments, reading for
    understanding
  • IPC
  • Critical Region
  • Difficulties solving problem
Write a Comment
User Comments (0)
About PowerShow.com