Talk:Futures

From The Oxygene Language Wiki

Jump to:navigation, search

The recursive binary tree calculation shown here seems like a worst-case scenario, actually. If you get a large binary tree, when it starts to calculate the left side it spawns a new thread and recursively calls Sum. That left side (running in a new thread) is a binary tree, containing a left side and a right side. To calculate the left side of that tree, it has to spawn another thread. To calculate the left side of that would require yet another thread, and so on. (Not to mention the left sides of the right-hand trees!) Thread pooling would be difficult after you go a few steps down, because the threads are already all in use. How do you run an algorithm like this on a tree with a few thousand nodes without spawning thousands (or at least hundreds) of threads? --Mason Wheeler 17:36, 22 May 2009 (UTC)----

Navigation
Areas
More
Toolbox