Is it possible to come up with a distributed / multi-core implementation of a simple sieve.

I am working on a simple sieve algorithm , and the main implementation works fine for me. What I'm currently struggling with is a way to split and distribute computing across multiple processors.

I know that this will require storing the actual sieve in the shared memory or text file area, but how could one divide the calculation-related steps.

Any guidance would help. Thank!

+4
source share
1 answer

Divide the numbers into sections of equal size, each processor will be responsible for one of these sections.

( ) , . .

, , , , .


, .

2, 3, 5 ..

, .

, 4, 4, , , " t - , , , , .

, , - , , (, bitwise-AND) , ( API), , , , , , , , , , . - , , .

+4

Source: https://habr.com/ru/post/1530409/


All Articles