home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5160 < prev    next >
Encoding:
Internet Message Format  |  1992-07-21  |  2.1 KB

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