A process is defined as an entity which represents the basic unit of work to be implemented in the system i.e. a process is a program in execution. The execution of a process must progress in a sequential fashion. In general, a process will need certain resources such as the CPU time, memory, files, I/O devices and etc. to accomplish its task.
Operation on Process
- Process Creation
- Destroy of a process
- Run a process
- Change a process priority
- Get process information
- Set process information
Process Creation
It’s a job of OS to create a process. There are four ways achieving it:
- For a batch environment a process is created in response to submission of a job.
- In Interactive environment, a process is created when a new user attempt to log on.
- The OS can create process to perform functions on the behalf a user program.
- A number of process can be generated from the main For the purpose of modularity or to exploit parallelism a user can create numbers of process.
Process Termination
A process terminates when it finishes executing its last statement. Its resources are returned to the system, it is purged from any system lists or tables, and its process control block (PCB) is erased. The new process terminates the existing process, usually due to following reasons:
- Normal Exit (Voluntary): Most processes terminate because they have done their job.
- Error Exist(Voluntary): When process discovers a fatal error. For example, a user tries to compile a program that does not exist.
- Fatal Error (Involuntary): An error caused by process due to a bug in program for example, executing an illegal instruction, referring non-existing memory or dividing by zero.
- Killed by another Process (Industrial): A process executes a system call telling the Operating Systems to terminate some other process. In UNIX, this call is kill. In some systems when a process kills all processes it created are killed as well (UNIX does not work this way).