async-avr icon indicating copy to clipboard operation
async-avr copied to clipboard

Use interrupts for Wakers

Open lights0123 opened this issue 5 years ago • 7 comments

This is currently blocked waiting for an LLVM bug to be fixed, but we can work on other things to get ready. They tried to fix it, but there were some problems with the patch.

  • [ ] Wait for LLVM to fix their bug
  • [ ] Send a PR to Rahix/avr-hal to allow enabling interrupts
  • [ ] Figure out who should be responsible for listening for interrupts
    • Probably the user in the binary crate, but how?
    • Expose APIs that are called when an interrupt occurs?

lights0123 avatar Jul 26 '20 15:07 lights0123

Maybe, for the time being, one could implement a 'custom waker API' that does not use any function pointers? E.g. a global singleton "waker object" that is used unconditionally in all contexts?

Rahix avatar Jul 27 '20 11:07 Rahix

@Rahix Yeah, that's definitely possible. However, it will still introduce problems with third-party crates—things from the futures crate that work without alloc, for example.

lights0123 avatar Jul 27 '20 13:07 lights0123

Looks like the LLVM bug was fixed! https://reviews.llvm.org/D87631

jeremysalwen avatar Jan 09 '22 04:01 jeremysalwen

@jeremysalwen I've taken a break from this (well, because of this issue), but if you'd like to follow along, it looks like someone else is working on an executor based on my work: https://www.reddit.com/r/rust/comments/rxmy9k/comment/hrkb7il/?utm_source=share&utm_medium=web2x&context=3

lights0123 avatar Jan 09 '22 04:01 lights0123