jimi_diller Posted January 21, 2014 Report Share Posted January 21, 2014 Hi, What happens if: 1) I push a button so APP_DIN_NotifyToggle gets called 2) I quickly push a button again, before the previous APP_DIN_NotifyToggle was finished? Could I possibly see some problems with race conditions? Or can I trust that APP_DIN_NotifyToggle is run with no pre-emption?? I'm guessing the former would make the most sense. I'm also seeing some bugs which I suspect might be attributed to race conditions, but that might also be due to shared data between APP_Background and the notify hooks, now that I think of it... Thank you! Jimi Quote Link to comment Share on other sites More sharing options...
TK. Posted January 21, 2014 Report Share Posted January 21, 2014 Hi, MIOS32_SRIO will set a "changed" flag whenever a DIN pin has toggled during a scan. Even if the pin is toggled back to the original value, APP_DIN_NotifyToggle will still be called, but with the current value. In other words: it won't be called twice. If any edge is for interest, then you've to use the APP_SRIO_ServiceFinish() hook and detect pin changes from there (see also the various $MIOS32_PATH/modules/blm* examples) - but this is an interrupt. Time consuming operations (e.g. MIDI output) shouldn't be done from there. You would need to implement a queue mechanism if any pin change is really for interest. I'm also seeing some bugs which I suspect might be attributed to race conditions If you would describe your use case a little bit further, I could give you more concrete help how to solve the issues in your application... Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
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.