Date: Thu, 11 Feb 1999 22:30:53 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: dillon@apollo.backplane.com (Matthew Dillon) Cc: tlambert@primenet.com, peter.jeremy@auss2.alcatel.com.au, hackers@FreeBSD.ORG Subject: Re: portability of shm, mmap, pipes and socket IPC Message-ID: <199902112230.PAA18042@usr06.primenet.com> In-Reply-To: <199902112159.NAA95236@apollo.backplane.com> from "Matthew Dillon" at Feb 11, 99 01:59:52 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> :What about a negative initial value setting? > > What does POSIX have to say about it? Uh, it doesn't specifically disallow it. The POSIX RT stuff apparently deprecates the IPC interfaces (according to the Go Solo2 CDROM). The POSIX RT stuff doesn't allow for negative values (the semaphore value in semaphore.h is an unsigned int), but the semctl SETVAL operation does allow a negative number. In the strictest sense, I guess that my use has been deprecated: The POSIX Realtime Extension defines alternative interfaces for interprocess communication. Application developers who need to use IPC should design their applications so that modules using the IPC routines described in _IPC_ can be easily modified to use the alternative interfaces. I guess that this technically means that I should use two semaphores instead of one to implement the interlock (that's what I had to do on FreeBSD). Seems... inelegant, somehow. At the very least, it takes a lot more work to deal with client dropout. Ugh. The new interfaces aren't counting semaphores. That means that I'd need yet another semaphore to acquire the right to use the RPC mechanism. Bletcherous. Hm. On the old interfaces, there's nothing that says a negative semadj value, or one larger than sem_cnt, *isn't* allowed to happen... Go to the other (-1) example. My example is obviously abuse under the portability "should", even though it works on AIX, Solaris, SunOS, Dell UNIX, and UnixWare (they all share source code there, so that's not a surprise). If someone else is flagellating them negative, you could probably defend it not working. 8-(. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902112230.PAA18042>