chap03

chap03 - CSC 539: Operating Systems Structure and Design...

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

View Full Document Right Arrow Icon
CSC 539: Operating Systems Structure and Design Fall 2002 Processes and threads ± process concept ± process scheduling: state, PCB, process queues, schedulers ± process operations: create, terminate, wait, … ± cooperating processes: shared memory, message passing ± threads Process an operating system executes a variety of programs: batch system – jobs time-shared systems – user programs or tasks often, the terms job and process are used interchangeably a process is a program in execution a process (active entity) is both more and less than a program (passive entity) ± in addition to code, process involves program counter, registers, stack, data, … ± same program can produce more than one process (e.g., users running pine) ± the OS interleaves the execution of several processes to maximize processor utilization ± the OS supports InterProcess Communication (IPC) and user creation of processes
Background image of page 1

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

View Full DocumentRight Arrow Icon
Tracing process execution consider 3 processes in memory: ± OS must manage process scheduling ± Dispatcher swaps out active process if (1) timeout occurs, or (2) process requests I/O operation Simple queueing diagram in this simple system, a single queue suffices to store processes ± a process is either active (executing) or inactive (waiting) ± the dispatcher is code that assigns the CPU to one process or another it avoids wasted CPU cycles as the active process waits for I/O it prevents a single process from monopolizing CPU time (time slicing) note: this is the model from HW 2 Processor Enter Queue Dispatch Exit Pause
Background image of page 2
Process states as a process executes, it changes state New : the process is being created Running : instructions are being executed Waiting or blocked : the process is waiting for some event to occur (e.g., I/O operation) Ready : the process is waiting to be assigned to the CPU Terminated : the process has finished execution Tracing process states we can draw a timeline of CPU activity, identifying the states of the processes and Dispatcher
Background image of page 3

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

View Full DocumentRight Arrow Icon
Process Control Block (PCB) for each process, the OS must store all info needed to: ± execute the process ± save its execution state if interrupted ± restore its execution state and continue relevant info is stored in a Process Control Block (PCB), including: ± process state (e.g., ready, running, waiting, …) ± program counter (address of next instr to be executed) ± CPU registers (active data stored in registers) ± CPU scheduling info (process priority, ptrs to scheduling queues, …) ± ± accounting info (CPU time used, time limits, …)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 10/10/2010.

Page1 / 11

chap03 - CSC 539: Operating Systems Structure and Design...

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

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