9fans archive / 1995 / 03 / 33 /    prev next

From: forsyth@pla... forsyth@pla...
Subject: rendezvous
Date: Tue, 28 Mar 1995 09:47:04 -0500

>>I started using the library function rendezvous(2) to do some basic process
>>synchronization. Since I have some problems with installing a common tag
>>for both processes (two processes a parent-process and a forked child) I
>>was wondering me, if anybody has a running short application, which is
>>using the rendezvous(2) function.

if you're writing in C, not (yet) Alef, there are several examples in
the system:

/sys/src/cmd/exportfs and /sys/src/cmd/iostats use rendezvous
simply, in similar ways, to implement shared-memory multiprocess file servers.

/sys/src/cmd/disk/kfs (see the libp subdirectory) uses machine-specific
functions and the portable rendezvous() to implement two levels
of synchronisation (spin locks and queue locks).

what problems did you have, more specifically?  the most significant
thing to watch with rendezvous is that the processes must share the same
name space (ie, don't use RFNAMEG/RFCNAMEG in rfork).  a plain fork()
leaves parent and child sharing the name space so that shouldn't be a problem
in itself.