public class SieveGenerator{ static int N = 50; public static void main(String args[]){ int cores = Runtime.getRuntime().availableProcessors(); int f[] =
The Thread.isAlive() method can tell you if the Thread has already been started. Simply do this where you want to start your thread:
if(!t[p%cores].isAlive()){ t[p%cores].start(); }