Livelock Prevention


SimEvents® software includes features to prevent livelock. Livelock is a situation in which a block returns to the same state infinitely often at the same time instant. Typical cases include:

  • An entity that moves along a looped entity path with no passage of time and no logic to stop the entity for a nonzero period of time

  • An intergeneration time of 0 in an entity generator

  • A Signal-Based Function-Call Generator block that calls itself with a time delay of 0

  • A signal feedback loop in which event-based signals execute blocks in the loop repeatedly

The model below shows an example of livelock. The livelock prevention feature causes the simulation to halt with an error message. Without this error detection, an entity would move endlessly around the looped entity path without the simulation clock advancing.

Permit Large Finite Numbers of Simultaneous Events

If your simulation creates a large, but not infinite, number of simultaneous events, consider increasing the model's thresholds related to livelock prevention.

For example, if you modify the Preloading Queues with EntitiesPreloading Queues with Entities example by setting both the capacity of the queue and the number of iterations of the function-call generator to 2000, then the simulation creates 2000 simultaneous events with no infinite loops. To prevent a spurious error in this situation, increase the model's limit on the number of events per block to at least 2000.

To change the thresholds related to livelock prevention, use this procedure:

  1. Open the Configuration Parameters dialog box by selecting Simulation > Model Configuration Parameters from the model window's menu bar.

  2. Navigate to the SimEvents pane of the Configuration Parameters dialog box.

  3. Change the values of the Maximum events per block and Maximum events per model parameters.

  4. Apply the change by clicking OK or Apply.

Was this topic helpful?