Algosim documentation: Program modality loop protection

Program modality loop protection

Algosim programs are always executed in a background thread, so they almost never block the front end. However, since programs are able to produce modal dialog boxes in the graphical user interface, it is possible for unstoppable modal message loops to occur.

Here’s a trivial example:

repeat(
  MessageBox("Test")
)

Such programs, when executed, will prevent the user from doing anything with the Algosim front end, including terminating the offending program. Hence, any unsaved data in the current Algosim session will be lost.

To prevent this, the Algosim front end has a program modality loop protection system which detects unstoppable loops of modal message boxes and eventually interrupts the offending program to ask the user if he or she wants to terminate it:

Image 1

If the user chooses not to terminate the program, he or she will be asked again in a few seconds, unless he or she clicks the “Don’t ask again while executing this program” checkbox.