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:
parent
9cff4a57e7
commit
023c593d35
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue