Hi guys, I need an advice from you.I’m trying to build an application composed by 2 parts: Main and IOEvents.
Just to give an idea of the think I want to do, this should works as a state machine, that is the Main part is a switch/cases statement that set different flags and parameters of my machine depending on which case it is, while IOEvents part checks every X seconds the situation of I/O, buses and other signals generated by external devices (temperature sensors, buttons, IR beams, etc).
Both these parts share the same class GClass that contain all the variables needed to run the machine. Furthermore these parts are two different threads.
Ok, here is the question: how can I sinchronize these threads in order to access correctly the shared variables class ??
Use LOCK statement for every variable acess is too complicated…
Any hints ?
Thanks in advance