Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I do some recursive computation and like to divide the work to multiple CPUs. However, when inside some recursive work, it is very elaborate to get a new thread continue where we currently are, without the overhead of an artifical adressing-scheme to the recursed structures.

For large scale operations, fork() does this nicely as the resulting child process continues the work, just deciding for other tree pathes depending on its id.

For smaller works, fork() is too heavyweight to be useful, especially when complex memory mapping would be needed to integrate the results of all child processes.

Is there any thread framework that acts like fork() and may continue the new thread from the current execution location?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
525 views
Welcome To Ask or Share your Answers For Others

1 Answer

You may want to look at Intel's Threading Building Blocks.

https://www.threadingbuildingblocks.org/

Here's a case study of it being used on a data conditioning problem at Dreamworks, which is a recursive problem.

http://software.intel.com/en-us/articles/case-study-parallelizing-a-recursive-problem-with-intel-threading-building-blocks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...