Class SharedExecutorProtocolHolder

java.lang.Object
pt.unl.fct.di.novasys.babel2.core.AbstractBabelProtocolHolder
pt.unl.fct.di.novasys.babel2.core.SharedExecutorProtocolHolder
All Implemented Interfaces:
BabelProtocolHolder

public final class SharedExecutorProtocolHolder extends AbstractBabelProtocolHolder
A BabelProtocolHolder implementation that schedules event queue draining on a shared thread pool executor.

Multiple protocols can share the same executor, with each protocol maintaining its own lock-free MpscArrayQueue. Protocols cooperate by yielding execution after processing a configurable number of events per turn (batch size), preventing starvation.

  • Method Details

    • deliverEvent

      public void deliverEvent(BabelEvent event)
      Description copied from interface: BabelProtocolHolder
      Enqueues or delivers an event to the underlying protocol.
      Parameters:
      event - the event to deliver