----- Original Message ----- From: "Craig DeForest" <[email protected]>
To: "Sisyphus" <[email protected]>
Cc: "Craig DeForest" <[email protected]>; "[email protected] list" <[email protected]>
Sent: Thursday, December 08, 2011 4:53 PM
Subject: Re: [Perldl] Gnuplot beta test - dist file included in message


Thanks for doing this, Rob!

Hmmm, it appears that there is an IPC issue going on. I wonder whether it is deadlocking somehow.

I'll try to dive into the Run::IPC module to look for likely trouble spots.

Had a bit of a further poke at it today and there's a problem with IO::Select's can_read() method in that it just doesn't work on Windows, afaict. It returns immediately (irrespective of what value, if any, is assigned to the timeout). Turns out that error message about gnuplot having been unresponsive for 5 seconds is emitted approx 0.5 seconds after the script has loaded and starts to execute. And any array that is designated to collect the return value(s) of can_read() is always empty.

For a basic test script, I tried:
####################################
use warnings;
use IO::Select;

open(RD, '<', $0) or die "Can't open RD: $!";

$s = IO::Select->new();

$s->add(\*STDIN);
$s->add(\*STDOUT);
$s->add(\*STDERR);
$s->add(\*RD);

if($s->exists(\*STDIN)) {print "ok 1\n"}
if($s->exists(\*STDERR)) {print "ok 2\n"}
if($s->exists(\*STDOUT)) {print "ok 3\n"}
if($s->exists(\*RD)) {print "ok 4\n"}

@r1 = $s->can_read(5);
defined(@r1) ?  print "defined\n" : print "not defined\n";
print "\@r1 contains ", scalar(@r1), " elements\n";
#################################

which outputs (for both perl-5.8.9 and 5.14.0) on Windows:

ok 1
ok 2
ok 3
ok 4
not defined
@r1 contains 0 elements

On both Cygwin and linux, the same script outputs:

ok 1
ok 2
ok 3
ok 4
defined
@r1 contains 1 elements

The can_write() method appears to be similarly affected, whereas the 'exists', 'handles', 'count' and 'bits' methods seemed fine (in another test script that I ran).

I wonder how this can_read functionality can best be accommodated on Windows.

Cheers,
Rob

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to