[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

parallel testing on Win32 (was Re: Profiling parallel tests)



On Tue, Aug 19, 2008 at 01:04:21PM +0100, Andy Armstrong wrote:
> On 19 Aug 2008, at 12:54, Nicholas Clark wrote:
> >So I'm not sure if there is currently no parallel implementation for  
> >Win32.
> >Or at least, there isn't anything that can select, so it can't run
> >usefully in parallel.
> 
> Yeah, the problem is that you can't reliably select on filehandles...
> 
> >(Win32 can select on the file handles created by socketpair? If so,  
> >would an
> >implementation that created a socketpair and then arranged send  
> >child output
> >work? (is that "arranged" even possible?))
> 
> 
> That might work. It's quite a big change though. I'll have a think  
> about it.

The appended is rather sick, but I'm wondering if it works as a proof of
concept. With it, do tests actually run in parallel on Win32?
If so, we can work on making it clean.

Nicholas Clark

==== //depot/perl/ext/Test/Harness/lib/TAP/Parser/Iterator/Process.pm#2 - /home/nclark/p4perl/perl/ext/Test/Harness/lib/TAP/Parser/Iterator/Process.pm ====
--- /tmp/tmp.11496.95	2008-10-02 14:28:13.000000000 +0100
+++ /home/nclark/p4perl/perl/ext/Test/Harness/lib/TAP/Parser/Iterator/Process.pm	2008-10-02 14:06:45.000000000 +0100
@@ -95,6 +95,19 @@ sub _use_open3 {
         eval "use $module";
         return if $@;
     }
+
+    *IPC::Open3::xpipe = sub {
+	use Socket qw(AF_UNIX SOCK_STREAM PF_UNSPEC);
+
+	my $out_w = IO::Handle->new;
+	socketpair $_[0], $_[1], AF_UNIX, SOCK_STREAM, PF_UNSPEC
+	    or die "socketpair: $!";
+	# stop reading on the write handle:
+	shutdown $_[1], 0 or die "shutdown: $!";
+	# stop writing on the read handle:
+	shutdown $_[0], 1 or die "shutdown: $!"; 
+    };
+
     return 1;
 }
 


Follow-Ups from:
Andy Armstrong <andy@hexten.net>
"Steve Hay" <SteveHay@planit.com>
Andy Armstrong <andy@hexten.net>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]