Here is how I would use parallel features in Perl....<div><br></div><div><br></div><div>sub myfunc1()</div><div>{</div><div>   # do some long running thing here.</div><div>}</div><div><br></div><div>sub myfunc2()</div><div>
{</div><div>   # do another long running thing (perhaps a db query)</div><div>}</div><div><br></div><div>runthese(\&amp;myfunc1, \&amp;myfunc2)</div><div><br></div><div><br></div><div>Keeps it simple.</div><div>myfunc1() and myfunc2() run in parallel.</div>
<div>When the both finish runthese() returns.</div><div><br></div><div>runthese() should be able to be called from within a function that was invoked with runthese().</div><div>runthese should return an array of the return codes from the myfuncN().</div>
<div>runthese should be able to take any reasonable number of arguments, or perhaps an array of function pointers.</div><div><br></div><div>Some scheme should be developed such that the functions can read from the same file or socket with some guarantee that they will not read the same data.  Perhaps a specifier on a function that would tell perl to only allow one instance of that function to run at a time.</div>
<div><br></div><div>-- </div><div>Michael Potter</div>