I’m wondering if there is anyone who knows if there any problems with having objects running in separate threads having a two way dependency via events being raised in either class.
Eg. one thread is responsible for recieving measurments and sending data to external hardware. Then another thread is interested in knowing about some of these measurments, so it listens to an event and does some work with the information.
Then, when the second thread has come up with some interesting results it raises an event that the first thread is listening to. So the threads have objects listening to each other via events.
I can’t see why this wouldn’t work but I’m certainly no low level expert, so if there’s anyone who can see a problem with this it would be awesome if you could object.
I know that there probably are different ways you could implement the dependencies, but I thought it would be a neat way since the stuff in the background that would cause the events is aperiodical and somewhat random.
Oh, and the events would be the only interdependence between the objects, i.e no common varable that they could change or anything like that.