IPC is mechanisms an operating system provides to allow processes it manages to share data. provides to allow processes it man There are various synchronization techniques, e.g., software solutions, hardware solutions, Operating system solutions, and compiler based solutions.
(i) Strict alternation or turn variable or Dekker's algorithm
(ii) Use of flag variable
(iii) Peterson’s algorithm
(iv) Multiple process solution
Note: Note that Peterson’s algorithm is a combination of strict alternation and use of flag variable techniques. There are some drawbacks of software solutions, e.g., busy waiting is possible, difficult assumption for memory, complicated to program, blocking a process has more chances than waiting.
(i) Test and Set (or Test and Set lock) instruction
Note:These mechanisms depends on machine instructions. There are some drawbacks of hardware solutions, e.g., deadlock, starvation and busy waiting may be possible.
Solutions Based on Operating System
(i) Counting Semaphore
(ii) Binary Semaphore
Note:Semaphore increases complexity when a algorithm require more than one semaphore. Incorrect use of semaphores can cause deadlock and mutual exclusion problem.
Solutions Based on Programming Language
(i) Monitor is solution based on compiler.