Process Concept, Process states, Process control, Threads,
Concept of ProcessEdit
Process:- A process is basically a program while it is being executed. A process is active part of program. Program is passive part. A process is dynamic entity and program is static entity.
Every process is having PCB ( Process Control Block ). As we are performing scheduling we have to do context switching, so we have to store current contents of current process and reload the contents of next process. So we require PCB.
PCB contains :-
i) Process identification number which is unique for every process
ii) Program Counter :- The PC indicates the address of the next instruction to be executed for this current process.
iii) Priority Number is given to every process.
iv) Memory Allocation :- It contains the value of the registers, stack , etc ( Local Variables, Global Variables )
v) I/O Status Information :- Of all I/O’s are available in PCB.
vi) Process states available for process.
Q. Explain process with the help of PCB. ------ 4 marks
Q. Explain different process states .-------------- 6 marks
Ans :- Every process has following states :-
a) Create / New :- Operating system creates new process by using fork ( ) system call. These process are newly created process and resources are not allocated.
b) Ready :- The process is competing for CPU. There are number of processes in ready state.
c) Running :-= The process that is having CPU is considered as process in running state.
d) Blocked / Waiting :- The process is waiting for blocked until some external event occurs such as I/O operations.
e) Termination / End :- The process completes all its operation and releases all its resources.
1) When process is created it is transmitted to ready state.
2) From ready state depend on scheduling only one process is transferred to running state.
3) After completion of process it will end or terminate.
4) If process is required some external inputs, it will go in waiting state.
5) When process will get the required I/O it will get shifted to ready state.
6) If process is not waiting for external I/O , but CPU is removed from process and process will only wait for CPU it is moved to ready state.
Q. Explain thread in detail. --- -- 4 marks
Ans :- Thread is called as light weight process. It is used to handle burden of process or to simplify process. Thread is a dispatch able unit of work. It consist of thread ID, program counter, stack and register set.
Traditionally there is single thread of execution per process. In multithreading environment, O.S. supports multiple threads of execution within a single process.
Threads are of two types :-
1) User Level Thread :- User level thread uses user space for thread scheduling. They have low overheads. These threads are managed at run time. They are smaller and faster.
2) Kernel Level Thread :- Thread management is done by kernel. These threads are managed by system call.
- WikiNote Foundation