przemko icon

Współbieżność -- ciąg Fibonacciego

przemko | PRO | 06/14/17 10:29:53 AM UTC | 0 ⭐ | 10825 👁️ | Never ⏰ | []
Erlang |

300 B

|

None

|

0 👍

/

0 👎

%% fib2.erl
 
-module(fib2).
-export([fib/1]).
 
fib(0) -> 0;
fib(1) -> 1;
fib(N) ->
    fib2(N - 1) + fib(N - 2).
 
fib2(N) ->
    Pid = spawn(fun worker/0),
    Pid ! {self(), N},
    receive
        F -> F
    end.
 
worker() ->
    receive
        {From, N} -> From ! fib(N)
    end.

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • Suikzau icon
    03/31/26 10:06:05 PM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best t33n active cpx link daily updates!
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
     Remove the @ 
  • Zyubi icon
    04/05/26 02:32:22 AM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best t33n active cpx link daily updates!
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎