Bill Allombert on Thu, 08 Jan 2004 20:25:46 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Using fifos for in/output |
On Thu, Jan 08, 2004 at 02:15:33PM +0000, Prof. J. E. Cremona wrote: > [I am sending this to pari-dev, though I do not seem to have received > anything from pari-dev for ages. So this is partly a test to see if I > still subscribed to that.] > > A couple of months ago there were some interesting postings from Bill > and Karim about using a fifo (special unix file) for input. I am > interested in using a second fifo for output as well, either by > redirecting stout or by using write(). > > I really want this to work from within a C/C++ program, so that I can > start up a gp process in the background, have my program occasionally > send it input lines via its input fifo and then pick up the (one-line) > output from its output fifo. This would be more efficient than my > current practice of starting a new "slave" gp for each such > calculation, and getting its output via a temporary (ordinary) file to > which gp directs its output. Maybe you can reuse code from pariGUIde, <http://sourceforge.net/projects/pariguide/> file gpcontroller.cpp, <http://cvs.sourceforge.net/viewcvs.py/*checkout*/pariguide/pariguide/pariguide/gpcontroller.cpp> It implement exactly this functionnality. I don't think there are any buffering issue. Cheers, Bill.