1) Give a description of the problem
According to the documentation, pistons take a local copy of global variables when they execute, thus the global variables become local variables. I’ve been trying to use global variable for “inter-piston communication”. I want to tell them all to cancel based on a signal from one of the others.
I’ve been trying to use a local variable “WakeUpCancelled” to signal to all the other pistons that the wake up process has been cancelled and that they should all terminate. Obviously it doesn’t work because the global variable is a local one for each piston.
How can I use some kind of semaphore to indicate to other running pistons that they should halt their execution?