I’ve been writing a lot recently about Parallel computing and programming and I do notice that there are a lot of patterns that come up when it comes to parallel computing. Noting that Microsoft already has released a library along with the Microsoft Visual C++ 2010 Community Technical Preview (named Parallel Patterns Library) I’m wondering what are the common parallel programming patterns you have been using and encountering that may be worth remembering? Do you have any idioms you follow and patterns that you seem to keep popping up as you write parallel programs with C++?
I’ve been writing a lot recently about Parallel computing and programming and I do
Share
Patterns:
Produce/Consumer
Loop parallelism
each iteration can be done in a sperate thread
Re-Draw Thread
Main-Event Thread
This (helps) prevents the UI from freezing
But may cause excessive re-draws if not done carefully.
Work Group
Thread works on one work item until complete
Once completed thread returns to queue.