daveb@pyuxf.UUCP (david berk) (01/07/88)
I know this is a silly question but..... Could someone explain how shared memory works on the 7300 and what the advantages to using it are. Thanx; Dave Berk ihnp4!pyuxf!daveb
ford@crash.cts.com (Michael Ditto) (01/11/88)
In article <216@pyuxf.UUCP> daveb@pyuxf.UUCP (david berk) writes: >Could someone explain how shared memory works on the 7300 >and what the advantages to using it are. Shared memory is a standard feature of System V Unix; read the System V Programmer's Manuals for detailed information. (It's under shmop(2), shmat(2), shmctl(2), etc.). Shared memory is primarily useful for interprocess communication. Several programs (or several copies of the same program) can all have access to an area of memory. An example of how this might be used is a multi-player game, where each player is running the same game program. Each player's process writes into the shared memory whenever that player makes a move. The other players' programs look at the shared memory and display what move the first player made. The same thing could be done with a file, but files are not as efficient, especially when small amounts of information must be accessed very frequently. Other IPC mechanisms include signals, pipes, message queues, and semaphores. -- Mike Ditto -=] Ford [=- P.O. Box 1721 ford%kenobi@crash.CTS.COM Bonita, CA 92002 ford@crash.CTS.COM
mark@cogent.UUCP (Captain Neptune) (01/12/88)
In article <2325@crash.cts.com> ford%kenobi@crash.CTS.COM (Michael Ditto) writes: >In article <216@pyuxf.UUCP> daveb@pyuxf.UUCP (david berk) writes: >>Could someone explain how shared memory works... >Shared memory is primarily useful for interprocess communication. Several >programs (or several copies of the same program) can all have access to an >area of memory... > >Other IPC mechanisms include signals, pipes, message queues, and semaphores. I've been studying IPC lately, and, correct me if I'm wrong, but, I am led to understand that some sort of locking must be employed to use shared memory effectively. Typically, this might be in the form of semaphores used to insure that only one process at a time updates the chunk of shared memory. Reading from the chunk of shared memory might be less demanding of such restrictions. Is this correct and on target? -- # Mark ###################### Ernie: Gee, Bert! Where'd all your files go ? # # Steven #################### Bert: My files! Er-r-r-r-r-r-rnie-e-e-e-e !! # # Jeghers ############ {ihnp4,cbosgd,lll-lcc}!ptsfa!cogent!{mark,shawn!mark} # # Standard Disclaimer: Don't sue me. Sue my company. They have more money. #