It is my first time using spin and I am encountering an error that I do not understand. I am aware that the processes terminates in the same order they are created thus I don't understand why the process of the function I call in a loop does not terminate. Here is a very simplified version of my code :
int limit;
proctype f() {
limit--;
printm(limit)
run g();
}
proctype g() {
limit++;
}
init {
limit = 5;
do
:: (limit > 0) -> run f();
od
}
The limit variable is created so there is not more than 5 processes f
running at the same time. The processes g
does terminate but f
don't. So I get the error : too many processes
I would like to know why f
does not terminate and if there is another way to do that?