/** * Create new thread around runnable task. * * @param r Runnable task to execute in the thread. * @return New thread around runnable task. * @see GridTestThread */ @Override public Thread newThread(final Runnable r) { return newThread(GridTestUtils.makeCallable(r, null)); }
/** * Runs runnable object in specified number of threads. * * @param run Target runnable. * @param threadNum Number of threads. * @param threadName Thread name. * @return Execution time in milliseconds. * @throws Exception Thrown if at least one runnable execution failed. */ public static long runMultiThreaded(Runnable run, int threadNum, String threadName) throws Exception { return runMultiThreaded(makeCallable(run, null), threadNum, threadName); }
/** * Runs runnable object in specified number of threads. * * @param run Target runnable. * @param threadNum Number of threads. * @param threadName Thread name. * @return Future for the run. Future returns execution time in milliseconds. */ public static IgniteInternalFuture<Long> runMultiThreadedAsync(Runnable run, int threadNum, String threadName) { return runMultiThreadedAsync(makeCallable(run, null), threadNum, threadName); }