Livelock Prevention

Overview

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:

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.

Permitting 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 Preload Queue with Entities demo 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 > 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.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS