Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^3: Non-recursive Ackermann

by ikegami (Pope)
on Feb 04, 2011 at 16:24 UTC ( #886243=note: print w/replies, xml ) Need Help??

in reply to Re^2: Non-recursive Ackermann
in thread [OT]: threading recursive subroutines.

[ Just a few rushed little comments ]


we don't know the range.

would require lock-stepping the threading-

with the minimal effort required for each step

I reached the same conclusions.

it requires that it has multiple, independant, recursive calls at each level.

That's why I used fib at first and called Ackermann a whole other ball game.

The interesting thing now is: how many recursive algorithms fit that pattern?

Any divide and conquer algorithm, for starters. That's where the dependency graph came in. I wanted to see if there was a split in it that could be exploited.

wonder why you do a loop initialisation rather than

I didn't know what I was going to end up with when I started. The code got refactored multiple times. I didn't micro-optimise.

(Upd: Put differently, the snippet is a theoretical implementation, not a practical one. Work still needs to be done to make it practical. Well, as practical as Ackermann can be. )

why for(;;) not while( 1 )?

It's what the code I learned from used. I've never used while (1). I like for (;;) cause I read it as "for ever". Trivia: Since the entire bound check of while (CONSTANT) gets optimised away, and since "while" and C-style "for" use the same opcodes, while (1) and for (;;) are practically identical internally.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://886243]
[Corion]: Meh ... Minion really doesn't want to run under the fork() emulation on Windows (which I understand), but has no other way either (which I find inconvenient)
[Corion]: Other than that, it seems really polished

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2018-06-21 15:01 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.