in reply to Re^2: wait for threads to end in parallel
in thread wait for threads to end in parallel
Syntax. async is shorter, but can only pass args via capture.
Not so. async is identical to threads->create(), except that it is invoked as a function rather than a class method:
# 'async' is a function alias for the 'threads->create()' method sub async (&;@) { unshift(@_, 'threads'); # Use "goto" trick to avoid pad problems from 5.8.1 (fixed in 5.8. +2) goto &create; }
So async \&sub, $arg, 1, 'fred'; or even async{ ... } $arg, 1, 'fred';
are identical in effect to threads->create( \&sub, $arg, 1, 'fred' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: wait for threads to end in parallel
by ikegami (Patriarch) on Mar 16, 2010 at 16:47 UTC | |
by BrowserUk (Patriarch) on Mar 16, 2010 at 17:11 UTC | |
by ikegami (Patriarch) on Mar 16, 2010 at 18:09 UTC |