protected <T>void runTasksConcurrent(final List<AbstractTask<T>> tasks) throws InterruptedException {
  assert resourceManager.overflowTasksConcurrent >= 0;
  try {
    final List<Future<T>> futures=resourceManager.getConcurrencyManager().invokeAll(tasks,resourceManager.overflowTimeout,TimeUnit.MILLISECONDS);
    final Iterator<AbstractTask<T>> titr=tasks.iterator();
    for (    Future<? extends Object> f : futures) {
      final AbstractTask<T> task=titr.next();
      getFutureForTask(f,task,0L,TimeUnit.NANOSECONDS);
    }
  }
  finally {
  }
}

protected < T > void runTasksConcurrent ( final List < AbstractTask < T > > tasks ) throws InterruptedException { assert resourceManager . overflowTasksConcurrent >= 0 ; try { final List < Future < T > > futures = resourceManager . getConcurrencyManager ( ) . invokeAll ( tasks , resourceManager . overflowTimeout , TimeUnit . MILLISECONDS ) ; final Iterator < AbstractTask < T > > titr = tasks . iterator ( ) ; for ( Future < ? extends Object > f : futures ) { final AbstractTask < T > task = titr . next ( ) ; getFutureForTask ( f , task , 0L , TimeUnit . NANOSECONDS ) ; } } finally { } }
runs the overflow tasks in parallel , cancelling any tasks which have not completed if we run out of time . a dedicated thread pool is allocated for this purpose . depending on the configuration , it will be either a cached thread pool ( full parallelism ) or a fixed thread pool ( limited parallelism ) .
