Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: [OT]: threading recursive subroutines.

by ikegami (Pope)
on Feb 02, 2011 at 19:58 UTC ( #885839=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub fibonacci {
       my ($n) = @_;
    ...
       return 1 if $n == 1;
       return sum fibonacci($n-2), fibonacci($n-1);
    }
    
  2. or download this
    sub fibonacci {
       my ($n) = @_;
    ...
          async { fibonacci($n-2) },
          async { fibonacci($n-1) };
    }
    
  3. or download this
    sub fibonacci {
       my ($n) = @_;
    ...
          async_maybe { fibonacci($n-2) },
          async_maybe { fibonacci($n-1) };
    }
    
  4. or download this
    sub fibonacci {
       my ($n) = @_;
    ...
       #      must call $on_complete->($x+$y).
    
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885839]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-09-18 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (103 votes), past polls