tags: os parallelism multiprocessing process
Race condition
This is a situation in which two or more process try to access a shared resources at the same time where sequence of accessing can alter the resulting output.
Critical Region
A part of the program where the program access the shared resource.
Conditions to avoid race conditions
- No two process should go to their critical regions at the same time.
- No process running outside its critical region should block other process
- No process should wait to enter its critical region
Mutual exclusion
It is a way to making sure if some process is using a shared resource, some other process should be excluded to access that resource.