From owner-freebsd-hackers Mon Nov 11 06:16:12 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA15721 for hackers-outgoing; Mon, 11 Nov 1996 06:16:12 -0800 (PST) Received: from terra.Sarnoff.COM (terra.sarnoff.com [130.33.11.203]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id GAA15713 for ; Mon, 11 Nov 1996 06:16:09 -0800 (PST) Received: (from rminnich@localhost) by terra.Sarnoff.COM (8.6.12/8.6.12) id JAA15080; Mon, 11 Nov 1996 09:15:02 -0500 Date: Mon, 11 Nov 1996 09:15:02 -0500 (EST) From: "Ron G. Minnich" X-Sender: rminnich@terra To: "Marc G. Fournier" cc: Tim Pierce , hackers@freebsd.org Subject: Re: semaphores/shared memory In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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