paul@hp-lsd.UUCP (07/10/84)
Nf-From: hp-lsd!paul Jul 24 10:16:00 1984
The basic win with named pipes (or FIFO's) is that you can connect unrelated
processes with pipes. GWYN@BRL gave a good general use for them and I can
add a couple more along the same lines:
Games: Now you can have your "gamesmaster" (database keeper?)
run all the time and just connect to it when playing is
convenient.
(More seriously - any global database managing program can be wired
this way)
Message-based systems can be implemented (somewhat) if you remember
that writes to pipes of 4K or less (a safe value I think on seeing
various unices) are atomic. This means that if you separate your
writes to the pipes (ie.. length followed by data) you can read
from several processes at once on one channel (nice since you don't
have select() in SYS-III). [This is a good way to tell the
gamesmaster that you want to play now - and can potentially handle all
the input from the various simultaneous players]. For message-based
systems, it is probably nice to have a publicly known "mailbox"
(or named pipe) connected to a name server for finding out who
else is "out there".
As mentioned, line printer spoolers are a good application as well
as most any time you want to arbitrate one resource with a program
(even a network connection?).
--Paul Bame
HP Logic Systems Division - Colorado Springs
{ihnp4!hpfcla, hplabs} !hp-lsd!paultdxsys@dartvax.UUCP (TDX sys Mark Mullen) (07/13/84)
I have just switched from V7 to SYSTEM III, and am very curious about
using the async pipes that you can create via mknod. Anyone who has any info
that they can share involving this would be a freingdiend for life!!!
<<< ASK NOT FOR WHOM THE BELL TOLLS AND YOU WILL ONLY PAY STATION TO STAIOTION
TRATES
>>>gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (07/17/84)
I assume you are referring to FIFOs. Think of these as "named pipes". The only use I have figured out for FIFOs is for some resource server (e.g. line printer spooler) which would loop reading from its publicly- known FIFO awaiting request packets; a request would be accomplished simply by opening the FIFO under its public name and writing a request packet to the server.
toby@gargoyle.UChicago.UUCP (Toby Harness) (07/18/84)
You can also think of FIFOs as a poor-man`s IPC (Inter-Process Communication). That is, if you have two (or more!) processes that you would like to have talk to one another and yet are not parent-child related, FIFOs are an easy way (the only way in sys iii?) to go. If necessay, you can synchronize the processes that are to talk and listen via signals, say SIGUSR1 and SIGUSR2. Toby Harness Ogburn/Stouffer Center, University of Chicago ...ihnp4!gargoyle!toby