OS Process 1
OS Process 1
OS Process 1
Process Concept
Process Scheduling
Operations on Processes
Process
Program: Passive entity
Process is instance of a program under
executing
Process – a program in execution
– Active Entity b/c it has Program
Counter associated to it.
Queuing Diagram
Ready Queue And Various I/O Device Queues
Ready Queue is implemented using Linked
List
MCQ
When the process issues an I/O request
__________
a) It is placed in an I/O queue
b) It is placed in a waiting queue
c) It is placed in the ready queue
d) It is placed in the Job queue
MCQ
Ans: a
MCQ
What will happen when a process
terminates?
a) It is removed from all queues
b) It is removed from all, but the job queue
c) Its process control block is de-allocated
d) Its process control block is never de-
allocated
MCQ
Ans: a
MCQ
Suppose that a process is in “Blocked”
state waiting for some I/O service. When
the service is completed, it goes to the
__________
a) Running state
b) Ready state
c) Suspended state
d) Terminated state
MCQ
Ans: b
MCQ
The context of a process in the PCB of a
process does contain __________
I. the value of the CPU registers
II. the process state
III. memory-management information
IV. context switch time
A.Only I
B Both II and III
C I, II, III
D. All of the mentioned
MCQ
Ans: c
Operations on Process
1. Process Creation
2. Process Termination
Process Creation
Parent process create children processes,
which, in turn create other processes, forming
a tree of processes
The process which creates other process, is
termed the parent of the other process, while
the created sub-process is termed its child.
Each process is given an integer identifier,
termed as process identifier, or PID. The
parent PID (PPID) is also stored for each
process.
Process Creation (Cont.)
Resource sharing
Parent and children share all resources
Children share subset of parent’s resources
Parent and child share no resources
Execution Sequence
Parent and children execute concurrently
Parent waits until children terminate
Process Creation (Cont.)
Address Space
UNIX examples
fork () system call creates new process
exec() system call used after a fork to replace the process’ memory
space with a new program
fork()
System call fork() is used to create processes.