Phones OFF Please. Inter-Process Communication (IPC) Parminder Singh Kang Home: www.cse.dmu.ac.uk/~pkang Email: [email protected] IPC Most modern operating systems are multi-tasking (e.g. Unix, O/S2, Linux, Windows Nt, Windows 95).
if freeslots > 0 then
add an item
decrease freeslots by 1
if freeslots < BUFSIZE then
remove an item
increase freeslots by 1
Shared files - similar to shared memory in virtual memory systems, since the file
Note: The section of code which accesses the shared memory is called the critical section. To ensure race conditions cannot occur we need mutual exclusion - only one process is in its critical section at a time.
the consumer sends a wakeup, which gets lost, since nothing is asleep yet