🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
3 messages
3 total messages Started by Christopher Davey Tue, 21 Jul 1992 15:52
shared memory & semaphores
#153
Author: Christopher Davey
Date: Tue, 21 Jul 1992 15:52
12 lines
638 bytes
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".

Thanks in Advance,
Chris
-----
chris@quay.ie
Re: shared memory & semaphores
#165
Author: Sam Streeper
Date: Wed, 22 Jul 1992 00:15
37 lines
2158 bytes
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?
Re: shared memory & semaphores
#169
Author: Alex Blakemore
Date: Wed, 22 Jul 1992 03:17
43 lines
1965 bytes
In article <199221Jul.155203.11220@quay.ie> 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?

This is a general text and not programming language specific, but very good IMHO

  Concurrent Programming
  Principles and Practice
  Gregory Andrews
  Benjamin/Cummins Publishing 1991
  ISBN 0-8053-0086-4
  637 pages

It discusses program verification techniques 
(pretty crucial to at least informally understand for concurrent programming)
shared variables
semaphores
conditional critical regions
monitors
asynchronous message passing
synchronous message passing
RPC
rendezvous

other topics include: barrier synchronization, fine and course grained
atomicity, on the fly garbage collection, split binary semaphores,
scheduling issues, safety and liveness, client server systems.

like the title says there is in depth theory (well explained not cryptic)
examples, design guidelines and rationale and history/discussion of
programming languages including CSP, Occam, Ada, Turing Plus, SR and Linda
that provide support for concurrent programming - the principles obviously
carry over if you use Mach library routines instead.

it may be more than you need if you just want a simple binary semaphore
and need the NeXT appropriate function name, but if you are serious about
concurrent programming - its a neo classic.
-- 
-------------------------------
Alex Blakemore alex@cs.umd.edu
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads