These materials are for the short unit on multi-threaded programming described here. They are provided for your use; feel free to use them as is or to modify them as needed. Please do let me know if you use these, however, particularly if you make improvements.

- Lab assignment introducing multi-threading as PDF or LaTeX.
- Code referenced in the lab: SerialPrimes.java, ThreadedPrimes.java
- HW assignment as PDF or LaTeX
- Code referenced in the homework: FastSerialPrimes.java, ThreadedPrimesFixed.java
- Version of the lab using C instead of Java (written by Don Blaheta) as PDF or LaTeX.
- Code for C version of the lab: serial_primes.c, threaded_primes.c
- It turns out that my "improved algorithm" is still not the fastest. John Hunt wrote a version that uses an array of booleans to record whether each value is a prime and crosses off multiples of primes rather than checking for divisibility, which turns out to be MUCH faster than the best parallel version I created. His code is available here.