Docsity

Operating System Processes: Concepts, Models, and Multiprogramming, Slides of Computer Science

Partial preview of the text

Download Operating System Processes: Concepts, Models, and Multiprogramming and more Slides Computer Science in PDF only on Docsity!

Process Description

z Process y Process description y Key concept of the process y Examples of the process z Two-state Process Model z Uniprogramming z Mutliprogramming z Process Creation z Process Termination

Major Requirements of an

Operating System

z Interleave the execution of the number of processes to maximize processor utilization while providing reasonable response time z Allocate resources to processes z Support interprocess communication and user creation of processes

Key Concept of Process

z processes are separated:

no process can directly affect the state of another process.

Process is a Key OS

Abstraction that Users See

z The environment you interact with when you use a computer is built up out of processes.

Dispatcher

z Program that moves the processor from one process to another z Prevents a single process from monopolizing processor time

Two-State Process Model

Running^ Not Running

Processor

Enter

Dispatch

Pause

Exit

(a) State transition diagram

Enter Queue^ Dispatch Exit

Pause (a) Queuing diagram

Problem:

users often wish to perform

more than one activity at a

time and uniprogramming

does not allow this.

z Uniprogrammed systems put in things like memory-resident programs that invoked asynchronously. One key problem with DOS is that there is no memory protection - one program may write the memory of another program, causing bugs. Docsity.com

Multiprogramming

z Multiprogramming:

multiple processes at a time

z Typical multiprogramming example: Unix

Key issue:

Fairness for Multiprogramming

z Must ensure that:

all processes get their fair share of the CPU.

Process Creation

z Submission of a batch job z User logs on z Create to provide a service such as printing z Spawned by an existing process

Reasons for Process

Termination

z Normal completion z Time limit exceeded z Memory unavailable z Bounds violation z Protection error y example write to read-only file z Arithmetic error z Time overrun y process waited longer than a specified maximum for an event Docsity.com

Reasons for Process

Termination

z I/O failure

z Invalid instruction

y happens when try to execute data

z Data misuse

z Operating system intervention

y such as when deadlock occurs

z Parent terminates so child processes terminate

z Parent request

A Five-State Model (1)

z Running z Ready z Blocked z New z Exit

Five-State Process Model

New Ready Running Exit

Blocked

Admit

Event Occurs

Dispatch (^) Release

Time-out

Event Wait