Date: Mon, 11 Nov 1996 09:15:02 -0500 (EST) From: "Ron G. Minnich" <rminnich@Sarnoff.COM> To: "Marc G. Fournier" <scrappy@ki.net> Cc: Tim Pierce <twpierce@bio-3.bsd.uchicago.edu>, hackers@freebsd.org Subject: Re: semaphores/shared memory Message-ID: <Pine.SUN.3.91.961111091352.15025A-100000@terra> In-Reply-To: <Pine.NEB.3.95.961111054151.10127G-100000@quagmire.ki.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 11 Nov 1996, Marc G. Fournier wrote: > On Sun, 10 Nov 1996, Tim Pierce wrote: > > No, sorry, even this shouldn't be necessary. Have the server > > create the semaphore and increment its value to 1. Then have each > > client wait until the semaphore becomes 0. When the data has been > > written to shared memory, have the server decrement the semaphore > > to zero, which will unblock all of the clients. > Okay, now bearing in mind that I'm looking at the examples as > presented in "Unix Network Programming" by W. Richard Stevens...how > do n clients signal back to the server that its finished with the data > and can send up the next set of data? have the lock lock a bitmask. Then use fdsets to set/clear bits. Client 'n' does and FDSET(n, ready_mask). I've done this -- works fine. server should initially zero the mask. ron
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.961111091352.15025A-100000>