0% found this document useful (0 votes)
120 views6 pages

1.3 Different Types of Process and Its Types in Operating System

The document discusses the programmer's view of processes and process scheduling from an operating systems perspective. It provides definitions and explanations of key concepts: - A process is an executing program, while a program is the static, stored set of instructions. A process goes through various states like ready, running, waiting during its lifespan from creation to termination. - An operating system uses a scheduler and scheduling algorithms to allocate CPU time between multiple ready processes, giving the illusion of multitasking. In reality, only one process runs at a time on the CPU. - Process states include new, ready, running, waiting, and terminated. State transitions occur due to events like I/O completion, scheduling timeouts, and process

Uploaded by

Darshit Chhatbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views6 pages

1.3 Different Types of Process and Its Types in Operating System

The document discusses the programmer's view of processes and process scheduling from an operating systems perspective. It provides definitions and explanations of key concepts: - A process is an executing program, while a program is the static, stored set of instructions. A process goes through various states like ready, running, waiting during its lifespan from creation to termination. - An operating system uses a scheduler and scheduling algorithms to allocate CPU time between multiple ready processes, giving the illusion of multitasking. In reality, only one process runs at a time on the CPU. - Process states include new, ready, running, waiting, and terminated. State transitions occur due to events like I/O completion, scheduling timeouts, and process

Uploaded by

Darshit Chhatbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Q - 1 Explain Programmer’s View of Process?

➢ Process:
• A process is instance of a computer program that is being executed or A process is a program in
execution mode.
• One by one all instructions are read from the program and specified operations are performed.
• A process is dynamic/Active entity. It changes its states during its time duration of execution. It
takes birth (creation), lives (execution) and dies (termination).
• A process has limited life span. It starts when program is executed. It performs various operations
specified by instruction given in program and terminate once all instructions get executed.
• A process contains various resources like memory, disk, printer, scanner etc. as per its
requirement.
• A process contains memory space which is called address space. It is a list of memory locations
(addresses).
• Address space contains three parts:
o Code: It contains executable statements.
o Data: It contains global variables.
o Stack: It contains temporary data such as method parameters, return addresses and local
variables.
➢ Program:
• A program is an organized collection of instructions.
• A program is a static/passive entity. Once user writes a program, it will remain as it is until user
modifies it.
• A program has a longer life span. Once a program is written in some file and stored on disk, it
remains there till file is not deleted.
• A program is stored on disk in a file. It doesn’t contain any other resources.
• A program contains memory space on disk to store all the instruction only.

Q - 2 Explain Process Model Overview.


• Modern Operating Systems are multitasking systems. They permit multiple programs to be loaded
into the main memory and execute them concurrently.
• In reality, it provides only illusion that all processes are running concurrently.

Page 1
• CPU can do only one work at a time. It cannot execute more than one instruction at the same time.
So, the CPU can handle only single process at a time.
• CPU is multiplexed in TIME among several processes which are loaded in main memory.
• Processes take turn to use CPU. One process is selected to use the CPU and it will be executed.
Other processes will wait for the CPU to become free.
• When currently running process waits for some event, such as I/O operation, CPU becomes free.
• Now, another process is selected to use the CPU. This cycle continues to execute all processes.
• This explains in following diagram, Suppose word start its execution, after some time it allocate CPU
to printing process and it will start execution. When fix time of process is complete at that time CPU
allocate to download process. This cycle continues till execution of all processes get complete.

Q - 3 What are different states of Process? OR Explain Process state diagram.


• A process is a dynamic/active entity. It changes its states during its execution.
• A process state indicates current activity of a process.
• Each process may be in one of the following state during its life span.

Page 2
New Admitted Terminated
Scheduler Time -Out
Error/Kill/
Complete
Ready Running

Scheuler Dispatch

I/o or event
I/o or event Wait
completion
Waiting

1) New:
• When a process is first created, it occupies ‘New’ state. In this state, process awaits to enter in
‘Ready’ state.
2) Ready:
• A process which is in the ‘Ready’ state has been loaded into main memory. In this state, process
awaits for execution on a CPU. It is possible that more than one process may be in ‘Ready’ state at
a time.
3) Running:
• A process which is in the ‘Running’ state is currently executing on a CPU. In a one processor system,
one and only one process can be in this state at a time.
4) Waiting:
• A process which is in the waiting state is waiting for some I/O completion or some event to occur.
• For example, consider that some process requires printer to print documents but printer is being
used by some other process. So, process will wait and it will be in this state till the printer
becomes free.
5) Terminated:
• When process terminates, it acquires this state. A process can terminate by completing its
execution, or it can be killed by another process or some error.

Page 3
• These state transitions occur on various events. Such events and corresponding state transition
are described in the following table.
From State Event To State
New Admitted Ready
Ready Scheduling Running
Running Need I/O Waiting
Running Scheduler Time-Out Ready
Running Error/Kill/Complete Terminated
Waiting I/O or Event Completion Ready

Q - 4 Define following with respect to Process Scheduling.


1) Scheduling:
• Scheduling is the process of making a choice of which process to run next whenever more than
one processes are simultaneously in the ‘Ready’ state.
2) Scheduler:
• Scheduler is an OS module which actually makes a choice of which process to run next whenever
more than one processes are simultaneously in the ‘Ready’ state.
• Scheduling refers to the entire procedure of selecting a process, while scheduler does this job of
selecting.
3) Scheduling Algorithm:
• Scheduling algorithm is an algorithm which is used by the scheduler in making a choice of which
process to run next whenever more than one processes are simultaneously in the ‘Ready’ state.
• Any scheduling algorithm should be able to fulfill the following goals:
o It should optimize the utilization of system resources. (Efficiency)
o It should be fair to all pending processes. (No Corruption)
o It should ensure that more critical processes get priority over others.

Q - 5 Explain Process behavior.


• The success of CPU scheduling is depends on this property of processes.
• Process execution begins with a CPU burst.
• CPU burst is the time duration for which process executes continuously before waiting for
an I/O operation.

Page 4
• I/O operation involves operations either related to reading an input from some device or a file, or
writing an output to some device or a file.
• Process alternates its execution between CPU burst and I/O burst.
• In CPU burst, it acquires CPU and instructions are executed sequentially. Process will be in
‘Running’ state during CPU burst.
• In I/O burst, process waits for some I/O operation to complete and CPU becomes free. Process will
be in ‘Waiting state’. This free CPU can be allocated to other process to allow it to run.
• Depending upon the behavior of execution, processes can be classified as-
1) CPU bound process
o It contains long CPU burst and thus infrequent I/O wait.
o It performs lots of computation or processing.
o It does little I/O.
o It keeps CPU busy most of the time.

Long CPU burst Waiting for I/O

2) I/O bound process


o It contains short CPU burst and thus contain frequent I/O wait.
o It performs little computation and does lots of I/O operation.
o It keeps waiting for I/O operation to complete most of the time.

Short CPU burst Waiting for I/O

Q - 6 When We Schedule a Process? OR When we require to schedule a new process


scheduling needed in which case?
• There are various situation in which scheduling is required as given below.

Page 5
o When process switches from running state to waiting state. When process invokes I/O
operation it doesn’t need CPU. So, CPU becomes free and other process can be selected to
run.
o When process switches from running state to terminated state. When process completes its
execution, it doesn’t need CPU anymore and CPU becomes free.
o When process switches from running state to ready state. When process completes its
allowed time duration to use CPU, CPU is taken away from that process and allocated to some
other process.
o When process switches from waiting state to ready state. When I/O operation completes, or
an event, for which process is waiting, completes.

Q – 7 Differentiate Preemptive versus Non-preemptive scheduling.


1) Non-preemptive scheduling
o Here, one process is selected to execute. Then, it is allowed to run until it voluntarily enters
into the wait state or gets terminated.
o Simple but its not efficient.
o Doesn’t require time or clock interrupt.

2) Preemptive scheduling
o Here one process is selected to execute. Then it is allowed to run only for some maximum
time duration. After that duration, another process is selected to execute (if any another
process is available).
o Very efficient but complex.
o Requires timer and clock interrupt.
o

Page 6

You might also like