Sorry all but I didn't know where to post this,
I have a threadpool and I want to run a threadpooltest, but when I compile the threadpooltest it says it cannot recognise the fullstop between "out" and "printIn"
Here's the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| public class ThreadPoolTest {
public static void main(String[] args) { if (args.length != 2) { System.out.printIn("Tests the ThreadPool task."); System.out.printIn( "Usage: java ThreadPoolTest numTasks numThreads"); System.out.printIn( " numTasks - integer: number of tasks to run."); System.out.printIn( " numThreads - integer: number of threads " + "in the thread pool."); return;
} int numTasks = Integer.parseInt(args[0]); int numThreads = Integer.parseInt(args[1]);
ThreadPool ThreadPool = new ThreadPool (numThreads);
for (int i=0; i<numTasks; i++) { ThreadPool.runTask(createTask(i)); }
ThreadPool.join(); }
private static Runnable createTask(final int taskID) { return new Runnable() { public void run() { System.out.printIn("Task " + taskID + ": start");
try { Thread.sleep(500); } catch (InterruptedException ex) {}
System.out.printIn("Task " + taskID + ": end"); } }; } } |
If anyone can help it would be much appreciated.
Cheers,
Hauk