https://36kr.com/p/5073181

“Problem: To print in ascending order all primes less than 10000. Use an array of processes, SIEVE, in which each process inputs a prime from its predecessor and prints it. The process then inputs an ascending stream of numbers from its predecessor and passes them on to its successor, suppressing any that are multiples of the original prime.”

predecessor [ 'pri:disesə, 'pre- ]

  • n. one who precedes you in time (as in holding a position or office)

successor [ sək'sesə ]

  • n. a person who follows next in order

golang 并发求素数 prime number CSP

相关文章: