Process:-
A program under execution is called process. When a bunch of code loads to physical memory (RAM) for execution then it is called a process.
Types of the process:-
There are basically two types of processes.
Types of the process:-
There are basically two types of processes.
1.Independent Process:-
If the process does not depend on any other process is called an independent process. That means inside the program if there are no resources (like variable, memory, i/o devices,etc..)are shared with any other program then it is called independent process.
2. Co-operative Process:-
If one process depends on another process execution means if any portion(or section) of the code in one process depends upon any other process execution, it is called the Co-operative process.
Because it shares some resources, it goes through any kind of issue.
Race Around Condition:-

Let's consider a common variable v in which initial value is 5 shared between two co-operative processes called process 1 and process 2. If we execute process 1 first and context switch to process 2 by sleep function call and again continue when process 2 goes to sleep then we get the final value of v is 4 or If we execute process 2 first and context switch to process 1 then also we get the final value as 6. But as per our program, we just increment the value of v by 1 in one process and decrements that in another process .so the value of v supposes to be the same that is 5. But both cases we get 4 and 6 which are effectively wrong values according to this program.
If the order of execution of two or more process changes the result, then it is called the Race Around Condition. In the co-operative process only we face the race around conditions.
To avoid this race around condition we need to synchronize the processes.
If the order of execution of two or more process changes the result, then it is called the Race Around Condition. In the co-operative process only we face the race around conditions.
To avoid this race around condition we need to synchronize the processes.
Process Synchronization:-
Synchronization between two or more co-operative processes that decide in which order the process will get execute is called process synchronization.
Critical Section:-
Critical Section:-
The section in a program that contains any shared resources (like a variable, hardware, or memory) is shared between two or more co-operative processes is called a critical section. When a process is going to access a common shareable variable then it enters into the critical section.
A race condition is a special condition that may occur inside a critical section. A critical section is a section of code that is executed by multiple threads.
When the result of multiple threads executing a critical section may differ depending on the sequence in which the threads execute, the critical section is said to contain a race condition. This is called a critical section problem.
The solution to this critical section problem must archive the 3 rules of synchronization.
If the critical section is free and some processes want to access the critical section. Then the selection of process which is access to the critical section first shouldn't be for an infinite time.
In some cases, every process blocks each other in order to archive the critical section in that way we can't found the progress. The synchronized process should avoid this condition.
3. Bounded Waiting:-
If a process make request to enter into critical section, But operating system allows other processes to enter into the critical section. So there should be some time-bound up to which the request will be denied to access the critical section. That is called Bounded Waiting.



