CS250 Project 5: Parallel Processing

Due Tuesday, May 7, at 1:30 PM (Start of the Final Exam)

Parallel processing is required to fully utilize most modern CPUs. This assignment is intended to give you some practical experience in parallel programming. Finding of prime numbers, used for systems such as RSA, is computationally intensive, but can make use of multiple processors. For this project, create a program which will find the first 50 million prime numbers, and store them in a list. Starting code (mostly test cases) is included in p5_primes_start.c.
For speed testing, find the first 50 millon primes. My solution takes about 13 minutes to do this in one thread on isoptera.
Besides writing the program, figure out how many threads generate the fastest performance. This number will vary based on your particular solution.

Hints

The pthreads library is not covered at all in the book. The manpages cover the individual functions, and "man pthreads" will provide a summary, but this may not be the most accessible documentation. Here are a couple suggestions:
Complete, but maybe more details than you need: https://computing.llnl.gov/tutorials/pthreads/
Fairly detailed: http://randu.org/tutorials/threads/