From: Hans-Bernhard B. <br...@ph...> - 2004-01-08 12:32:50
|
On Wed, 7 Jan 2004, Ethan Merritt wrote: > So it isn't really a race. It's just that if we are going to > switch to unbuffered mode we should first make sure the > buffer is empty, or else store it elsewhere for later execution. Doing so will *make* it a race, then. A race between gnuplot going from 'read all that's in the buffer' and 'set to unbuffered' on one side of the track, and the external program re-filling the buffer on the other. And that's before we consider that there's no way, AFAIK, to read only the buffer, for stdin. You only get to notice the buffer is empty when it tries to read one past the end --- at which point it blocks, and gnuplot becomes irresponsive. I suspect we'll have to avoid stdin buffering and possibly blocking I/O altogether. I.e. don't switch off buffering halfway into the program, but immediately after startup, before the first character is read. -- Hans-Bernhard Broeker (br...@ph...) Even if all the snow were burnt, ashes would remain. |