Received: from PACIFIC-CARRIER-ANNEX.MIT.EDU by po7.MIT.EDU (5.61/4.7) id AA01957; Sat, 2 Dec 95 15:39:36 EST
Received: from freefall.FreeBSD.ORG by MIT.EDU with SMTP
	id AA24978; Sat, 2 Dec 95 15:38:33 EST
Received: from localhost (daemon@localhost)
          by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id JAA18940
          ; Sat, 2 Dec 1995 09:57:15 -0800
Received: (from root@localhost)
          by freefall.freebsd.org (8.6.12/8.6.6) id JAA18471
          for hackers-outgoing; Sat, 2 Dec 1995 09:52:40 -0800
Received: from jau.csc.fi (root@jau.csc.fi [193.166.1.196])
          by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id JAA18463
          ; Sat, 2 Dec 1995 09:52:35 -0800
Received: (from jau@localhost) by jau.csc.fi (8.6.12/8.6.12+CSC-2.1) id TAA22091; Sat, 2 Dec 1995 19:50:57 +0200
From: Jukka Ukkonen <jau@jau.csc.fi>
Message-Id: <199512021750.TAA22091@jau.csc.fi>
Subject: msleep(2) & mwakeup(2) ???
To: questions@freebsd.org, hackers@freebsd.org
Date: Sat, 2 Dec 1995 19:50:57 +0200 (EET)
Latin-Date: Simbata II Decembrie a.d. MCMXCV
Organization: Private person
Phone: +358-0-6215280 (home)
Content-Conversion: prohibited
X-Mailer: ELM [version 2.4 PL24]
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Content-Length: 1804      
Sender: owner-hackers@freebsd.org
Precedence: bulk


	Hi all!

	Does anyone know whatever happened to those synchronization
	primitives that are mentioned in 4.4BSD Architecture Manual
	(see PSD:5-11)?
	After writing initial versions of POSIX.4 shm_open() and
	shm_unlink() I thought about implementing POSIX.4 counting
	semaphores using mmap()'ed shared memory and msleep(),
	mwakeup(), mset(), and mclear(), but when I checked none of
	these synchronization routines were present in source files.
	Or maybe I just did not look for them in the correct place.
	At least they were not in the source trees of FreeBSD-2.0.5
	or 4.4BSD-Lite, which I have on CD at home. I did not check
	FreeBSD-2.1.0 yet.
	Does anybody have a better idea where to look? At the bottom
	of the manual page that I mentioned above there is a note
	"All currently unimplemented, no entry points exist." Is this
	still true or has someone already tried adding them?
	Supposedly it would not be terribly difficult to add these
	binary semaphores though.
	At the first glance it looked to me that only msleep() and
	mwakeup() would really need to be supported by the kernel
	unless one wants also something like mtimedsleep() to be
	a single system call instead of two calls, the first one to
	set a timer and then msleep(). Mset() and mclear() could
	(when efficiency is concerned they presumably even should) 
	be plain wrappers to bus-interlocked machine instructions
	in the style of test-and-clear.


	Cheers,
		// jau
------
  /    Jukka A. Ukkonen,       FUNET / Centre for Scientific Computing
 /__   M.Sc. (sw-eng & cs)               Tel:   (Home) +358-0-6215280
   /   Internet: ukkonen@csc.fi                 (Work) +358-0-4573208
  /    Internet: jau@funet.fi                 (Mobile) +358-400-606671
 v     X.400:    c=fi, admd=fumail, no prmd, org=csc, pn=jukka.ukkonen
