Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!usc!ucsd!pacbell.com!pacbell!att!mcdchg!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.questions Subject: Re: Question on interprocess communication and signals Keywords: interprocess communication, pipes, signals, notify procedure, SunView Message-ID: <1990Aug30.144415.2728@chinet.chi.il.us> Date: 30 Aug 90 14:44:15 GMT References: <265@jabberwock.shs.ohio-state.edu> Distribution: usa Organization: Chinet - Chicago Public Access UNIX Lines: 24 In article <265@jabberwock.shs.ohio-state.edu> reiner@jabberwock.shs.ohio-state.edu (Reiner Wilhelms) writes: >Question 2: >How can one build a communication line between the two such that A >dials B, and says: "Hey, I have a new data set for you!" Essentially >program A "presses the read-new-data button" of program B. What would >the notification routine look like, and what kind of signals could I >use to establish the cooperation of the two programs? You probably have select() which can block while waiting for any of several inputs, but since I'm stuck with SysV for the moment, my favorite technique is to funnel all inputs through a single pipe (or FIFO where it is inconvienent to make all processes have a common parent). In your case, the screen-drawing program might read all its commands from a pipe fed by both the keyboard-reading process and the data-generating process. There are some tricks to make it work, though. The commands must either be of a fixed length or contain a length field so that the reader can seperate them at the original boundaries, and the complete command must be written in a single write() and must be less than PIPE_MAX in size to avoid interleaving with data from a different process. Les Mikesell les@chinet.chi.il.us