By Kirit A. Dhabalia
Content
Interprocess Communication Interprocess Synchronization Semaphores Locks Monitors and Condition Variables
Interprocess Communication
Supported by OS, allow one process to communicate with another process. Could be on same computer or different computer connected through a network It is not generally supported by single process operating systems such as DOS. OS/2 and MS windows support an IPC mechanism called Dynamic Data Exchange If process needs to print its result, it must request the OS gives access to the printers device driver. OS must decide to grant the access, provided printer is not being used by another process otherwise process will be waiting until availability. Critical resource: It is a resource shared with constraints on its use (memory, files, printer ) Critical Section : It is code that accesses a critical resource Mutual Exclusion : both processes do not attempt to use the resource at the same time (Ex. Printer)
Interprocess Communication
Shared-Memory System Message-Passing System
Direct Indirect
Capacity Link
Zero Capacity Bounded Capacity Unbounded Capacity
Interprocess Synchronization
Serialization Mutexes: Mutual Exclusion Critical Sections: The Mutex Solution Bakerys Algorithm
Readers and Writers Problem Dining Philosophers Problem Sleeping Barber Problem
Readers and Writers Problem Dining Philosophers Problem Sleeping Barber Problem
Locks
Locks are another synchronization mechanism These locks has got two operation
Acquire Release
A process will acquire a lock before accessing a shared variable and later it will be released The difference between a lock and a semaphore is that a lock is released only by the process that have acquired if earlier
Thank You