|
From: Craig D. <def...@bo...> - 2013-02-12 20:10:15
|
Is there any way to interrupt gnuplot and either ask for out-of-band status or tell it to revert to a prompt, when it's expecting binary data input from stdin? I currently manage PDL::Graphics::Gnuplot, a Perl front-end for gnuplot plotting. The module provides a Perl API that generates Gnuplot commands and ships data over a pipe to a gnuplot process. A major compatibility and reliability issue that we have is that, in binary mode (which we use for speed) gnuplot locks up until its full complement of data has been read. This causes several problems: - There's no documented way (that I've found) for our perl process to know in advance if gnuplot is working or locked-up (e.g. sometimes the x11 terminal can take a long time to render a plot if the DISPLAY is remote) - Slow rendering jobs can be interrupted by the user, and there's no documented way (that I've found) to let gnuplot know to stop what it's doing and give a prompt back. That means we have to drop-kick the gnuplot process and restart it (which loses state and also generates a new display window on interactive terminals) - Some platforms munge pipe contents, and there's no way to diagnose that problem. The only workaround I can see would be to generate temporary files and ask gnuplot to read those - but that incurs more overhead since we are then using the file system instead of direct IPC. Cheers, Craig DeForest |