Process Operation in Operating System
Most systems support at least two types of operations that can be invoked on a process creation and process deletion.
Process Creation
A parent process and then children of that process can be created. When more than one process is created several possible implementations exist.
- Parent and child can execute concurrently.
- The Parents waits until all of its children have terminated.
- The parent and children share all resources in common.
- The children share only a subset of their parent’s resources.
Process Termination
A child process can be terminated in the following ways:
- A parent may terminate the execution of one of its children for a following reasons:
- The child has exceeded its allocation resource usage.
- The task assigned to its child is no longer required.
- If a parent has terminated than its children must be terminated.
Principles of Concurrency
Both interleaved and overlapped processes can be viewed as examples of concurrent processes, they both present the same problems.
The relative speed of execution cannot be predicted. It depends on the following:
- The activities of other processes
- The way operating system handles interrupts
- The scheduling policies of the operating system
Problems in Concurrency
- Sharing global resources: Sharing of global resources safely is difficult. If two processes both make use of a global variable and both perform read and write on that variable, then the order in which various read and write are executed is critical.
- Optimal allocation of resources: It is difficult for the operating system to manage the allocation of resources optimally.
- Locating programming errors: It is very difficult to locate a programming error because reports are usually not reproducible.
- Locking the channel: It may be inefficient for the operating system to simply lock the channel and prevents its use by other processes.
Concurrency in Operating System
Concurrency is the execution of multiple instruction sequences at the same time. It happens in the operating system when there are several process threads running in parallel. The running process threads always communicate with each other through shared memory or message passing. Concurrency results in the sharing of resources resulting in problems like deadlocks and resource starvation.
It helps in techniques like coordinating the execution of processes, memory allocation, and execution scheduling for maximizing throughput.
There are several motivations for allowing concurrent execution
- Physical resource Sharing: Multiuser environment since hardware resources are limited
- Logical resource Sharing: Shared file (same piece of information)
- Computation Speedup: Parallel execution
- Modularity: Divide system functions into separation processes
Contact Us