I’m using wiringPiISR (thanks Björn Eiríksson) to detect pressing of 4x4 keypad and it works perfectly.
I’ve followed example on Einhugur except I have four InterruptModules.
Now I’ve noticed that it’s added and uncommented in new GPIO release with scary note: “Unfortunately, wiringPiISR runs the callback on a preemptive thread making this method unsafe to use with Xojo.”.
I don’t even know what does preemptive thread mean, so my question is How scared I shoud be?
Should I stop using it even though it’s working?
Can someone explain my risks like For Dummies style?
Replace “preemptive” by “background” and you have an idea of whats going on.
The function does not fire on the main thread but on a background thread. This kind of stuff is officially unsupported by Xojo. There is a limited number of things you can do on a background thread, but none of them are supported and could stop working in the future.
Its up to you to decide if you change the interrupt handling or not. It is working currently, and it uses fewer resources than a timer looking endlessly for replies. If your project should stop working with a future Xojo release, this would be a place to search the reason then
There has been no known case where this fails when we isolate the interrupt with timer like that. I have ran such on server boxes doing all sorts of measures for many many months without so much as a hickup.
Of course the warning is fair, it is easy to do it wrong by doing more than you should in the interrupt handler instead of isolating it right away with timer. And future versions who knows. But you know what to change if it was to come to that.