Calculating primes with threads and forked processes