Jump to content

Programming question regarding state variable changes


JTsao

Recommended Posts

I have a state variable called sLastAction - it is set to an integer value which represents, as the name suggests, the most recent "action" that happened in my house - an "action" can be a motion sensor turning on, a wall switch being turned on or off, a Harmony remote control activity starting, door opening, security zone being triggered, etc... - several programs rely on this variable being a specific value to run - they all contain an if statement similar the following "if sLastAction = 128 then..." - my question is:

What happens if the variable changes twice rapidly before the first program testing the first value gets to run?

Will that program be put into a queue so that it is guaranteed to run?  And the test condition will still be true?

Sorry, if this has been asked before

 

 

 

Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...