Running "N" foreground tasks in Java- September 14, 2007 A handy helper method for running "N" foreground tasks in Java with a timeout. A more sophisticated technique would permit examination of job status: Invokes <var>n<var> copies of the given <var>runnable<var>, timing out after <strong>10 unit<strong> with code InterruptedException. param n the number of threads to run param runnable the thread body to execute param timeout the timeout param unit the timeout unit throws InterruptedException.http://binkley.blogspot.com/2007/09/running-n-foreground-tasks-in-java.html |