Removed loop calling the ExecutionStrategy, since it was spinning.

In case of ProduceExecuteRun, the producer is called in a loop, and
it never returns null (unless stopped), so ExecutionStrategy.execute()
never returns.

In case of ExecuteProduceRun, ExecutionStrategy.execute() does return,
but only after it has arranged another thread to continue producing.
Therefore calling ExecutionStrategy.execute() in a loop was spinning
since the ExecutionStrategy had already arranged to produce with
another thread and therefore calling execute() again was a
no-operation hence causing the spinning.
This commit is contained in:
Simone Bordet 2014-12-23 17:01:10 +01:00
parent 9cff4a57e7
commit 023c593d35
1 changed files with 1 additions and 3 deletions

View File

@ -170,11 +170,9 @@ public class ManagedSelector extends AbstractLifeCycle implements Runnable, Dump
@Override
public void run()
{
while (isRunning() || isStopping())
_strategy.execute();
_strategy.execute();
}
@Override
public Runnable produce()
{