next up previous
Next: Memory Management Up: Comparison between Original Previous: Process Scheduling

Process Synchronization

  The only process synchronization primitive provided in the original Unix is the wait-event mechanism. Events are identified by integers that are conventionally the addresses of tables associated with those events. For example, the following system call wait() causes its caller to be suspended execution until one of its child process terminates:

	processid = wait();
When a child process terminates, it signals the event represented by its parent's process table entry. This simple synchronization mechanism has both an advantage and a disadvantage. No memory allocation is needed, this is the advantage. However this can be also a disadvantage. Unlike semaphore signaling to an event on which no process is waiting is not recorded. If the event is signaled by a hardware interrupt, a serious race condition problem may occur. If a process decides to wait for the event and the hardware interrupt signals the event during the transient period to the wait state, the process may wait for the event forever. In Solaris 2 , as we have seen in the section 6.8 of [4], adaptive mutexes and reader-writer locks are used to protect critical sections.

As Thompson mentioned in the section 4.3 of [2], the original Unix did not provide many inter-process communication method; indeed it seems that only pipe was available. The pipe system call returns a file descriptor, and processes having parent-child relation can communicate each other by the same read and write calls as file manipulations.

Solaris 2 supports more inter-process communication primitives. One is the socket which we used in the programming assignment. Socket was first implemented in Berkeley Unix, Solaris 2 also supports it as it is a descendant of BSD Unix. The domains supported in Solaris 2 are PF_UNIX which is used between the processes in the machine, and PF_INET which can be over the internet. Unlike SunOS 4.1, which is running on *.csee.usf.edu machines, Solaris 2 does not support PF_IMPLINK protocol (IMP ``host at IMP'' link layer). There are five (one them is actually not implemented) communication types available on Solaris 2 , like SOCK_STREAM (duplex byte stream, the one we used in our programming assignment, or SOCK_SEQPACKET (sequenced packet). Solaris 2 also supports shared memory primitives that can be used for inter-process communication as we used in the programming assignment.



next up previous
Next: Memory Management Up: Comparison between Original Previous: Process Scheduling



Hitoshi Oi
Wed Dec 20 23:53:45 EST 1995