I've a problem with my code using waituntil.
I have 2, single proc, using the same method, containing :
waituntil ("Condition = A" and SharedTrolley.occupied) prio 1;
Condition = B;
I use it that way because i need to make a reservation for the use of a trolley when the trolley is back and full. 2 single procs share the same trolley.
-> But, when the 2 single proc are at the same step of the method, and are both waiting for the waituntil conditions, when the conditions are true, i think that both are passing the next step of the method.
But, it's generating problems because only one can use the shared ressource !
I need that only the singleproc which is waiting for the longest time skip the waituntil statement....
How to modify my code in order to do this ?
Solved! Go to Solution.
I think you are wrong. If you use waituntil, only 1 Method will wake up. If you want both Methods to wake up, you would have to write stopuntil.
So, if 2 instances of the same method are waiting at the same waituntil (same priority), and the waituntil conditions become true.
If at the next step (after the waituntil), the method makes the condition to be false, only one instance will wake up ?
The instances don't simultaneously wake up when the conditions became true ?
the methods will wake up one after another and after each method(instance) the condition is checked anew, check the example, look at the @ (actual MU).
freelance simulation specialist