Pierre Abbat writes:
I suggest a couple of named pipes for control (the front end writes
to one and reads from the other, and mprime vice versa). Since
writing to a pipe whose reader is stuck can get you blocked when
the pipe is full, and writing to a pipe with nothing at the other
end results in a SIGPIPE, mprime should not output anything to the
pipe unless told to do so, and should trap SIGPIPE and turn off
output.
Um, there are easier ways. For one, file descriptors can be set
non-blocking on all (modern) UNIX variants, which prevents getting
stuck waiting for the other program and from getting a SIGPIPE.
Also, most modern UNIXs implement pipes on top of UNIX domain (local
to one machine) sockets; TCP/IP uses the same function call interface,
sockets, but different addressing (for likely obvious reasons).
See rw.c of the mers package and the Prime95 primenet.[ch] source code
for how TCP/IP sockets can be used. Feel free to ask me, privately,
detailed questions; I've been using TCP/IP via C, mostly for Mersenne
stuff oddly enough:), off and on since about 1986.
Will
http://www.garlic.com/~wedgingt/mersenne.html
_________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers