-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
polled operators #11
Comments
In PD I'm directly calling monome_grid_key_handler from inside a liblo server thread (set to receive monome keypresses), because there's no BEES event loop and was the quickest way to get things more-or-less working (ignoring obvious thread safety issues for now)... It seems that BEES proper is asynchronously polling midi/monome drivers for keypress/events on a 20ms timer loop... umm that means 20ms jitter between physical keypress & the device actually responding - not exactly snappy! So any reason we shouldn't be constantly polling for fresh midi/monome data from inside main right after calling check_events, and do away with polling timers for monome & midi stimuli? Obviously conscious this kind of change will further complicate the libavr32 merge a bit... |
here - like this... |
no argument there. if it works to switch to busy-loop USB reads, and doesn't impact other stuff, then surely, go for it. i would just be a little careful. ultimately all usb endpoint reads end up here: i would want to make sure this is reentrant. if it's not, then you would need to be disabling interrupts on every read; that could get unpleasant. also of course we could reduce the 20ms time. that does seem like a very high number, i assume faster polling was problematic. |
I guess stress-testing serial with a grid plugged in would be sufficient to know whether this is 'reentrant'? (had to google that word!) The way I see it, the function ftdi_read() was being also called before from main, but using several more layers of indirection (i.e the monome_poll_timer_callback song & dance). So (imho) this change can only exacerbate any concurrency problems... Well it's squished down into a single, easily reversible commit at any rate! |
is that true? i'm pretty sure it's like:
that is, it's being called from the timer interrupt. so it can't be interrupted. i'm just not sure what would happen if an interrupt came along right while |
Nope, total bs! You are correct, this is a bigger, more controversial change than I thought. Dunno how I managed to convince myself there was an extra level of event-loop indirection there, thanks for pointing out the mistake! |
need a mechanism to poll operators from TC as necessary
The text was updated successfully, but these errors were encountered: