Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process Description and Control. Process concepts n Definitions – replaces task, job – program in execution – entity that can be assigned to and executed.

Similar presentations


Presentation on theme: "Process Description and Control. Process concepts n Definitions – replaces task, job – program in execution – entity that can be assigned to and executed."— Presentation transcript:

1 Process Description and Control

2 Process concepts n Definitions – replaces task, job – program in execution – entity that can be assigned to and executed on a processor n Process states – running – ready – blocked n The main responsibility of an OS is to control the execution of processes

3 OS objectives and processes n Operating systems must interleave the execution of a number of processes – to maximize processor use – while providing reasonable response rate n Operating systems must allocate resources to processes – based on priorities – while avoiding deadlock n Operating systems may support – interprocess communications – user creation of processes

4 A two-state process model Enter Dispatch Exit Pause Not running Running n Process creation – new batch job – interactive login – OS created to provide a service – spawned by existing process n Process termination – normal completion – abnormal end (abend) t time related t protection error t program error t data error t I/O failure t memory error

5 Process state transitions with suspend and resume Running Blocked Ready Suspended blocked Suspended ready I/O or event completion Suspend Resume Suspend Resume Suspend I/O or event completion Dispatch Timer- runout I/O or event wait A C T I V E SWAPPED

6 Other related concepts n Suspend and swapping – not immediately available – may or may not be waiting for event or I/O – blocked may be independent of suspend – process was placed on suspend by an agent n OS and processes – the OS schedules and dispatches processes for execution by the processor, and allocates resources to processes – OS is the entity that manages the use of system resources by processes

7 OS control structures n What does the OS needs (a) to be able to control processes and (b) manage resources for them? – memory tables – I/O tables – file tables – process tables n These tables are maintained by the OS n How does it know what and how to create? – Initialization and configuration

8 Process control structures n What is the physical manifestation of a process? – a program or set of programs – a set of data locations for variables and constants – memory to hold programs and data – stack for procedure calls, parameter passing n PCB - Process Control Block – entity that defines a process to the OS – collection of process attributes: process identification, processor state and process control information.

9 OS core, kernel or supervisor n Execution modes: system or user modes n OS core or kernel – Process management t process creation and termination t process scheduling and dispatching t process switching t process synchronization and support for inter-process communication t management of PCBs – Memory management – I/O management – Support functions

10 Is the Operating System a process? Process switching U1U1.. U2U2 U3U3 UnUn O1O2 O3 On P1P1 P2P2 P3P3.. Kernel PnPn Process switching OS.. P1P1 P2P2 P3P3 PnPn 1. No, separate 2.No, subroutines 3. Yes

11 Processes and Threads n Process is a unit of: – resource ownership – dispatching n Threads – only an unit of dispatching – inside a process – saves time to create, switch and terminate n A good example: a file server process – each request as a thread – the process spawn the threads


Download ppt "Process Description and Control. Process concepts n Definitions – replaces task, job – program in execution – entity that can be assigned to and executed."

Similar presentations


Ads by Google