Entry invariance

from Wikipedia, the free encyclopedia

In the program , a routine or method is called reentrant ( English reentrant ) or reentrant designated when it is implemented so that they interrupted and the interrupt routine can be called again, and in continuing after the interruption returns the expected result. This includes not only the return value, but all program parameters that can be influenced by the method. A reentrant method therefore behaves as if it were implicitly encapsulated in a transaction. Entire computer programs or scripts are also evaluated from this point of view.

For reentrant methods, it is often the case that instances running at the same time cannot influence one another. The execution of each instance is then identical, regardless of how many other instances of this method there are. The aim of the design for such an entry invariant method is to ensure that no part of the program code itself is changed by the method and that process-specific information such as local variables is kept in separate memory areas.

Entry-invariant program constructs are the basis for many multitasking systems ( thread safety ).