- All Known Implementing Classes:
public interface ExecutionStrategyThread execution operations.
- Mikko Tommila
void wait(Future<?> future)While waiting for a
Futureto be completed, steal work from any running tasks and run it.
While this method may functionally appear to be equivalent to just calling
future.get()it should try its best to steal work from any other tasks submitted to the
ExecutorServiceof the current
ApfloatContext. It may in fact steal work using multiple threads, if the current
numberOfProcessorsto be more than one.
The purpose of this method is to allow keeping all threads of the
ExecutorService(and CPU cores) maximally busy at all times, while also not running an excessive number of parallel threads (only as many threads as there are CPU cores).
future- The Future to wait for.