Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process Management -Compiled for CSIT

Similar presentations


Presentation on theme: "Process Management -Compiled for CSIT"— Presentation transcript:

1 Process Management -Compiled for CSIT
(Ref: Modern Operating System, A.S Tannebum, Lecuture notes of Prof. Prashant Shenoy)

2 Topics to be Covered 2.1 Introduction to process and Threads 2.2 Interprocess Communication 2.3 Process Scheduling

3 What is Process Process Vs. Program? An abstraction of running process
A process is an instance of a computer program that is being executed. Process Vs. Program?

4

5 Process Management Provides ability to have (pseudo) concurrent operation even with only one CPU Turns single CPU into Multiple Virtual CPUs Multiprogramming achieved (not to be confused with multiprocessing) Gives illusion of parallelism (pseudoparallelism)

6 What is Multiprogramming
Multiprogramming is a technique to execute number of programs simultaneously by a single processor. In Multiprogramming, number of processes reside in main memory at a time. The OS picks and begins to executes one of the jobs in the main memory. If any I/O wait happened in a process, then CPU switches from that job to another job. Hence CPU in not idle at any time.

7 Multiprogramming (Contd…):
OS Job 1 Job 2 Job 3 Job 4 Job 5 Figure dipicts the layout of multiprogramming system. The main memory consists of 5 jobs at a time, the CPU executes one by one. Advantages: Efficient memory utilization Throughput increases CPU is never idle, so performance increases.

8 The Process Model Runable software organized into number of sequential process Process – An instance of a program, replete with registers, variables, and a program counter Each process has it own virtual CPU It has a program, input, output and a state The real CPU switches back and forth from process to process This rapid switching back and forth is called multiprogramming

9 Multiprogramming (a) Multiprogramming of four programs. (b) Conceptual model of four independent, sequential processes. (c) Only one program is active at once.

10 Windows Snapshot

11 Process Creation Events which can cause process creation
System initialization. Execution of a process creation system call by a running process. A user request to create a new process. Initiation of a batch job.

12 Process Termination Events which cause process termination:
Normal exit (voluntary). Error exit (voluntary). Fatal error (involuntary). Killed by another process (involuntary).

13

14 Threads

15

16 Single and multiple threaded Process

17

18 Process Vs Thread S.N. Process Thread 1
Process is heavy weight or resource intensive. Thread is light weight taking lesser resources than a process. 2 Process switching needs interaction with operating system. Thread switching does not need to interact with operating system. 3 In multiple processing environments each process executes the same code but has its own memory and file resources. All threads can share same set of open files, child processes. 4 If one process is blocked then no other process can execute until the first process is unblocked. While one thread is blocked and waiting, second thread in the same task can run. 5 Multiple processes without using threads use more resources. Multiple threaded processes use fewer resources. 6 In multiple processes each process operates independently of the others. One thread can read, write or change another thread's data.

19 Advantage Thread minimize context switching time.
Use of threads provides concurrency within a process. Efficient communication. Economy- It is more economical to create and context switch threads. Utilization of multiprocessor architectures to a greater scale and efficiency.

20

21

22 User Level threads

23

24

25 Kernel Level vs User Level

26

27

28 Thread Model Some operating system provide a combined user level thread and Kernel level thread facility. Eg: Solaris Multithreading models are three types Many to many relationship. Many to one relationship. One to one relationship.

29 Many to Many The many-to-many model multiplexes any number of user threads onto an equal or smaller number of kernel threads.

30 Many to One Many-to-one model maps many user level threads to one Kernel-level thread. 

31 One to One Model There is one-to-one relationship of user-level thread to the kernel-level thread. 

32 Reference Video lecture and lecture notes of Prashant Shenoy
TutorialPoints


Download ppt "Process Management -Compiled for CSIT"

Similar presentations


Ads by Google