Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Process Shared Mutex



Dario <email@hidden> wrote on 26.02.2004 18:19:16:

>
> ##### ##### #####
>
> __ iteration is human, recursion is divine __
>
> ##### ##### #####
>
> __ iteration is human, recursion is divine __

Now I know you're human ... ;-)

one more thing: recursion might be divine ideawise, but in real live ...

I once wrote some Java Application that parsed a whole website by
following the links.

At first i did this in a recursive manner. The result was that I runned
out of memory very soon.

I had to rewrite it that way that links weren't followed and parsed
immediately but written into a task list. After a page was parsed the next
would be taken from that task list: iterative solution. The required
ammount of memory was much less than before: recursion might result in
avalanche like effects if one step in recursion results in many
sub-recursions (like a chain reaction in a atomic bomb).

morale of the story:

recursion might be an interesting concept to teach and suitable for small
tasks. But if you're going to process large chunks of data you're almost
ever better of using a iterative approach.

philosophical morale of the story ;-):

while our world possibly was made by (a) god it is not made for gods.

greetings, Lars
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Process Shared Mutex (From: Dario <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.