OneVariable : interrupts is threads
DRANK

credit: /u/Lewbular on /r/tattoodesignsI love the tattoo "shrimps is bugs" because it is both absurd, and mostly true. Technically shrimps are not bugs, but they share a lot of qualities.In the same way, I'd like to assert interrupts is threads.interrupts is threadsIn embedded, unless you are using a real time operating system, you often don't have "threads" like you would on your desktop. Threads have two main interesting qualities in this context:They are pre-emptively scheduledThey have separate stacks/resourcesWe model interrupts "as if they were threads" in embedded Rust, because as far as Rust's safety guarantees are concerned, they ARE exactly the same.Pre-emptive schedulingAs threads are pre-emptively scheduled, one chunk of code might be stopped at ANY time, and another chunk of code may start running.Similar to a thread context switch: interrupts can happen at any time! The only difference is that the hardware is doing context switching for us, rather than some operating sys…

onevariable.com
Related Topics:
1 comments
  • 組み込みの文脈で割り込みってスレッドに似てるよねと。特にRustにおいてはプログラミング体験がほぼスレッドと変わらなくなる