Multithreading prime numbers program