c++ - Sieve of Eratosthenes by Data parallel method -


I am trying to implement the Eratosthenes sieve of the data parallel method using pthreads, but I do not Understanding how to find "2", Thread-1 is transmitted to all other threads, and when all other threads mark the multiples of 2, then they should wait again for the next prime minister. How will multiple waiting for thread be implemented?

Before viewing the actual program creation, you first need to get your algorithm right. I think you have a problem searching the function because you do not have any appropriate algorithm for parallel sieve.

For starters, parallel algorithms have an important criterion which is the distribution of work in thread. If all the threads are in the same way, then there will be no movement at all. But it is not completely clear what is distribution of work.

I am also not sure that you should wait for your thread. She is disabled; The best designs are those where all the threads are working all the time.


Comments