Aristos Queue Posted January 30, 2008 Report Share Posted January 30, 2008 QUOTE(crelf @ Jan 29 2008, 12:31 PM) That's the important point right there (emphasis added for emphasis) - and something I didn't know. Is this true, even when the event structures are on different targets? That I don't know. Until you asked the question, I didn't know you could register to listen for events that happened on another machine (or other app instance). My guess is that the other machine sends events to this machine, and those events merge into the regular event queue and are thereafter subject to the same handling rules. But I severely doubt that the other machine is holding waiting for any "I'm done" message to come back. You should test this. Quote Link to comment
gb119 Posted January 30, 2008 Report Share Posted January 30, 2008 QUOTE(Aristos Queue @ Jan 29 2008, 05:33 PM) Essentially, yes. Events are *always* fully handled in the order they occur. So if you have two separate event structures registered for separate events, and both events occur, the first to occur will finish its event case before the next one begins being handled, even if these are separate event structures. This is important in case the event structures are accessing common queues, global storage, hardware or other refnum type. If multiple event structures are handling the same event, then all of them must finish handling the event before the next one begins being handled. Ouch ! That would have been something I would have certainly fallen foul of - I can easily imagine a system with two 'quick' events being broadcast to multiple event structures, but one of the event structures being busy doing a longer task when the events are fired and me wondering why *none* of my event structures got the second event in a timely fashion.... Quote Link to comment
JDave Posted January 30, 2008 Report Share Posted January 30, 2008 QUOTE(Aristos Queue @ Jan 29 2008, 09:33 AM) Essentially, yes. Events are *always* fully handled in the order they occur. So if you have two separate event structures registered for separate events, and both events occur, the first to occur will finish its event case before the next one begins being handled, even if these are separate event structures. This is important in case the event structures are accessing common queues, global storage, hardware or other refnum type. If multiple event structures are handling the same event, then all of them must finish handling the event before the next one begins being handled. QUOTE(Gavin Burnell @ Jan 29 2008, 12:39 PM) Ouch ! That would have been something I would have certainly fallen foul of - I can easily imagine a system with two 'quick' events being broadcast to multiple event structures, but one of the event structures being busy doing a longer task when the events are fired and me wondering why *none* of my event structures got the second event in a timely fashion.... Which is just another very good reason to make the event structures complete as fast as possible. It would be best to use the event structures as simply structures that filter incoming events. Pass the work to a separate loop and leave the event structure nice and lean. Quote Link to comment
mrak1 Posted January 30, 2008 Report Share Posted January 30, 2008 Hi All, I am not sure if the question here is whether or not user events can be handled by multiple event structures executing in parallel. If this is the question, then I believe that the answer is that it can be done even if one of the event structures is being held up. I have attached an example that I believe demonstrates this. ... sorry for the ugly code.... Thanks, Mike Quote Link to comment
Ton Plomp Posted January 31, 2008 Report Share Posted January 31, 2008 QUOTE(Aristos Queue @ Jan 29 2008, 06:33 PM) If multiple event structures are handling the same event, then all of them must finish handling the event before the next one begins being handled. QUOTE(mrak1 @ Jan 29 2008, 10:34 PM) I am not sure if the question here is whether or not user events can be handled by multiple event structures executing in parallel. If this is the question, then I believe that the answer is that it can be done even if one of the event structures is being held up. I have attached an example that I believe demonstrates this. AQ is wrong (sorry), the code from Mike shows that the top loop is considerably slower. If you add the 'Exit Button\Change Event' to stop the loop you will understand why you need to finish an event handler fast. Ton Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.