threaded and multi-process versions of prime number generator