JOIN
 Select a Forum     Round Tables New Member Discussions News Discussions Algorithm Matches Marathon Matches NASA Tournament Lab TopCoder Cookbook High School Matches Sponsor Discussions Development Forums Design Forums Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings View: Flat (newest first)  | Threaded  | Tree Forums Tutorial Discussions Parallel Patterns: WaveFront Pattern tutorial Just process wavefront by wavefront?
 Just process wavefront by wavefront? | Reply Wavefront processing looks interesting. The funny thing about algorithms is they always look easy when they're explained well, otherwise they're really hard...Anyway, I couldnt help thinking, is there any reason why we cant just divide each wavefront by the number of threads, and process wavefront by wavefront?That way, there is little or no idle time issue (just rounding issues when you divide the length of the wavefront by the number of threads), and the communication is limited to the triggering of the next wavefront.As long as each thread uses the same algorithm for working out which bit of the current wavefront it is responsible for, just with a different thread number (1,2,3...), then communications is very small?So, if we have three threads, 1,2,3. First wave would be:`1`next would be:` 21`next would be:` 3 21`Then:` 1 3 21`... and so on.Obviously for the first few wave fronts, there's a little idle time, because the wavefront is small compared to the number of threads, but those will pass fairly quickly, and after that it will be quite evenly spread out?