On Tuesday, May 27, 2003, at 01:49 PM, Jonathan Scott Duff wrote:
I think there's some timing missing (or maybe it's just me). Executing a
Code junction implies that I have all of the routines I wish to execute
in parallel available at the same time. This is often not the case.
Or if adding a Code block to a junction is how you parallelize them at
differing times, then I think the syntax would be horrid. Besides *I*
don't want to have to keep track of the junction, I just want my threads
to execute.
I suppose you could make C<parallel> or whatever return a "thread group" object, which, if necessary, you could use to add additional blocks:
my $tgroup = parallel( &foo | &bar | &baz ); ... $tgroup.add( &fuz, &fup, &waz ); # three more
though I metaphysically like the idea of executing a junction of Code in parallel, and returning a junction of results. But that still keeps the idea of routine-like, as opposed to fork-like, threads.
And no matter what, we'd need to have a "global" thread group, so if your intent was to make a globally-parallel thread, you'd do it on a builtin var called $*THREADS or something.
MikeL