Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!linac!midway!gargoyle!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.questions Subject: Re: Help: pipe accross two processes Message-ID: <1990Dec04.050117.7239@chinet.chi.il.us> Date: 4 Dec 90 05:01:17 GMT References: <1510@ulowell.ulowell.edu> Organization: Chinet - Public Access UNIX Lines: 24 In article <1510@ulowell.ulowell.edu> mchetan@hawk.ulowell.edu (Munisuvratha Chetan) writes: >I have a problem with "pipe"s, which might have appeared earlier. >I have two processes - a server and a client. >The server runs in an infinite loop untill killed. >After the server is brought up, clients wil be forked, from a >different shell. If the clients know the process id of the >server, how can I establish a communication channel between the >two using pipes (and signals, if necessary) only. >I know how to create pipes between a parent and child. If your system supports FIFOs (named pipes) just let the server create on using a name known to the clients. All clients can write to the single FIFO read by the server (with some care to keep things that must not be interleaved in a single write()), and this will automatically schedule the requests. Communicating back to the client is a different problem. Depending on the circumstances, you might want the client to create a FIFO as well and pass its name in the request to the server, or you might use shared memory or ordinary files with the server sending a signal to the client when the output is completed and safe to read. (See the man page for mknod to find out if you have named pipes.) Les Mikesell les@chinet.chi.il.us