D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] point of named pipes?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 02 July 2002 10:08 pm, Jon Still wrote:

Named pipes are part of the file system, so that rules out networking
really, unless you use NFS (Warning: kludge alert).

names pipes, aka FIFO's don't work over NFS at all as they are a kernel 
thinggymajiggy.  The kernel defines S_FFIO, S_ISCHR, S_ISBLK, S_ISSOCK as 
special file types, which just use the innode->i_mode as a pointer for the 
kernel to handle what to do with it.

[greek]/sites# mkfifo moo
[greek]/sites# tail -f moo

[chicken]/sites# echo "Test" > moo

nothing appears on greek, and the echo on chicken blocks. (/sites/ is a shared 
nfs disk on both)

Now AFAIK the main uses of named pipes are for simple interprocess
communications, without the overhead of AF_UNIX sockets (or even
AF_INET).  

yup, sometimes useful for IPC when processes that arent't in the same process 
group need to communicate but cant't use ansestoral pipes.

for example, to signal a daemon running, via the webserver - the daemon could 
create /tmp/blahblah, then the webserver echo's something into the FIFO to 
signal it to reload a file.

they are extrmely fast, as nothing every hits disk, and don't use much memory 
at all as the write blocks until the process reading the fifo actually 
read()'s.

For example /dev/log is a named pipe I think, used for
communication with syslogd locally.

/dev/log is a unix domain socket (AF_UNIX), not to be confuzled with FIFO's.

~ Theo

- -- 

Theo Zourzouvillys
http://zozo.org.uk/

You look tired.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9IiaB448CrwpTn6YRAldhAKDEZYXjNKquZEkHrgKcgLyWo9fwvQCbBzyq
g/ZX3DprR5P2vNzeaNCFxOU=
=S7zp
-----END PGP SIGNATURE-----


--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly