Skip to main content
8 events
when toggle format what by license comment
Aug 20, 2020 at 9:18 history closed Milliways
joan
Dougie
Darth Vader
Needs details or clarity
Aug 17, 2020 at 15:47 comment added goldilocks ... The problem with "things happening at the same time" is really only one thread having to handle interrupts in the middle of doing something else. -- hence event based patterns are considered asynchronous (which does not mean event handling can't be synchronised in one thread, but it is more awkward than with threads, and the need to do so may indicate a significant design flaw). I know this information is not a solution to your problem, but it should help you to think more clearly about what actually is and is not happening.
Aug 17, 2020 at 15:47 comment added goldilocks Interrupts do not create or require additional threads; that they are "system level mutli-threading" is a perversion of the truth; they're more of a context switch. "What I get, when the interrupt is sensed, is both sets of instructions trying to run at the same time. I think this is multi-threading which is not what I want." -> To the contrary, what would solve your problem is multi-threading w/ synchronisation mechanisms (but I do not think python can really supply that)...
Aug 17, 2020 at 7:56 answer added joan timeline score: 2
Aug 17, 2020 at 3:41 review Close votes
Aug 20, 2020 at 9:18
Aug 17, 2020 at 3:19 comment added Milliways If you are going to use python forget threading (GIL prevents threads from running in parallel) - which isn't needed. Asking general questions without code is futile. I suggest you forget RPI.GPIO and try gpiozero.
Aug 17, 2020 at 2:44 comment added tlfong01 But interrupt is already Raspbian's build in, system level muti-threading. You don't need to use python multi-threading module for higher level stuff.
Aug 17, 2020 at 1:06 history asked Goose23 CC BY-SA 4.0