home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!rosie!NeXT.com
- From: sam_s@NeXT.com (Sam Streeper)
- Newsgroups: comp.sys.next.programmer
- Subject: Re: shared memory & semaphores
- Message-ID: <4385@rosie.NeXT.COM>
- Date: 22 Jul 92 00:15:22 GMT
- References: <199221Jul.155203.11220@quay.ie>
- Sender: news@NeXT.COM
- Reply-To: sam_s@NeXT.com
- Lines: 37
-
- chris@quay.ie (Christopher Davey) writes:
- > 2 Questions:
- > 1. Can anyone recommend a good book on the subjects of either or both of
- > * Shared Memory
- > * Semaphores
- > for programming on a NeXT?
- > 2. In the meantime, can anyone tell me what the calls are, because I can't
- > seem to track them down with "man" and "apropos".
-
- I don't think there's a supported way to do shared memory on the NeXT.
- (It's possible, but undocumented and subject to change. At any rate,
- Mach is a _leetle bit_ different from some other OS's with respect to
- shared memory) Someone will probably tell me I'm wrong.
-
- Mutex's can be used as semaphores among threads within a process. They
- busy-wait, so they're typically used to construct more elaborate locks that
- block (see mutex, condition_wait, etc in the manual)
-
- It almost (8^) sounds like you're trying to use shared memory and semaphores to
- construct a message passing scheme (if I might read into your question). If
- so, I suggest you reconsider your implementation to use Mach messages. Mach is
- really good at this sort of thing. You might use MiG to generate your rpc's,
- or you can construct messages by hand, though that's a bit tedious.
-
- The Speaker/Listener classes make messages between applications pretty easy.
- If you wait for NeXTSTEP 3.0, you'll get Distributed Objects which provides a
- very general and dynamic way to send Objective C messages between objects in
- different applications (in fact it's easier to send a message to a remote
- object than to find out whether the object is local or remote!)
-
- I hope I've been more helpful than presumptuous, but I doubt it... 8^O
-
- -sam
-
- --
- Opinions are not those of my employer. They're not even mine. They're
- probably wrong besides. How did they get in here, anyway?
-