I have some high level pistons that field events and then execute “DO” type piston to service the events. These “DO” type pistons may Pause and then Resume one another to simulate a mutual exclusion on various devices. The problem comes in that an event occurs which requires servicing by a piston which is currently Paused. In that case, execute function of the paused piston doesn’t execute and the event goes by the wayside without any processing. If there is some way to query the state of the servicing piston, then the fielding piston poll the state of the servicing piston and not issue an execute until the servicing piston has been resumed. I know that there is a small window where race condition may make this scheme fail, but I’m willing to accept that small period of time when a race condition exists. Thanks for any/all responses.
Is there some way to check if a piston is paused?
Gopack2
#2
Could you set a global variable to , let say paused before you pause it. Then check that variable and if it = paused. Then restore piston And execute the piston accordingly. Don’t forget to change the global variable again when you unpause to active. Etc?
Rit
#3
Yes … that would work. I was trying to keep all the control logic local within the fielding pistons and not resort to even more global variables (I didn’t want to come back in 6 months to update something and then have to scramble around all the pistons to understand the control flow). But you are correct, this is a solution. Sigh, I guess this will have to do.