home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!elroy.jpl.nasa.gov!jato!jdickson
- From: jdickson@jato.jpl.nasa.gov (Jeff Dickson)
- Subject: Re: IPC and shared memory
- Message-ID: <1993Jan2.081756.21863@jato.jpl.nasa.gov>
- Organization: Jet Propulsion Laboratory
- References: <Jean-Guy_Speton.056u@tvbbs.wimsey.bc.ca> <paulk.317w@terapin.com>
- Date: Sat, 2 Jan 1993 08:17:56 GMT
- Lines: 44
-
- In article <paulk.317w@terapin.com> paulk@terapin.com (Paul Kienitz) writes:
- >> I am looking for information on inter-process communications (IPC)
- >> and shared memory functions. Do the Amiga libraries have any
- >> functions along these lines?
- >
- >Sure, there's PutMsg() eh.
- >
- >> The reason I'm asking is I intend on writing a multi-line door, but
- >> have questions as to how the different processes of the door will
- >> communicate with one another. I have a few ideas in mind, but they
- >> all seem as if they will become extremely slow and inefficient with
- >> more than a few lines.
- >
- >Last time I messed around with a multiplayer game on a mainframe, the
- >way it was done, which worked pretty well, was to have an area of
- >memory that all the processes knew about, accessed through a locking
- >mechanism to protect crucial sections of code. The way to do this
- >under AmigaDOS is with a named SignalSemaphore. Tasks can arbitrate
- >access to the data by taking locks on the semaphore, and the process
- >of finding the semaphore by name allows the different tasks to all
- >get pointers to the same piece of memory, which the semaphore happens
- >to be the first item in.
-
- Sure, a signal semaphore is the way to go, but for efficiency reasons I don't
- think named ones are a good idea. You see to guard against the slight chance
- the semaphore could go away whilest trying to find it via FindSemaphore - you
- are supposed to protect the operation with the Forbid/Permit pair. Not only
- do you pull the plug on multitasking, but IMHO FindSemaphore is a waste of
- time if your usage of it is purely for the convenience of knowing it by name.
- I suggest simply making the signal semaphore globally known or just to the
- tasks/processes that wish to use it and forgo the FindSemaphore bit all
- together. Of course, this may not be an option. Just know that there is more
- than one.
-
- Jeff
-
-
-
-
- The way I
- do it is to make the signal semaphore known to every task/process that wishes
- to use it. This saves
-
-
-