Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
mbed_events.h: Add ability to request a shared event queue #4406
First pass at a couple of shared event queues.
To allow components with a simple need to schedule a few events to not
One initial in-tree user in this PR - the Nanomesh/mbed-client timer.
First out-of-tree users would be 6LoWPAN radio drivers like atmel-rf-driver.
First pass for comment.
I'm not particularly attached to any of the fine details here, but this is the basic functionality I'm looking for.
The "run normal event queue from main" option is one of those "why not" things - we may have a main() thread with nothing else to do after boot, so it's an obvious memory saving option.
changed the title from
Shared event queues
mbed_events.h: Add ability to request a shared event queue
May 31, 2017
jenkins/pr-head is failing in all Nanostack builds due to:
With 6lowpan and Thread it happens immediately after reset and with nanostack ethernet on network connect.
I really like where this is going. Few questions about the possibilities:
- Can the normal queue be bound to the main thread and on task change trampoline into queue.dispatch before returning execution into main? This would save a thread and do what I think the most common use case would be, signal the super loop
- Naming for the getters might need work.
- shared-normal config, not sure what this does but IMO simple use cases first and then we can expand functionality / options
One background note - I currently have no users waiting for the normal event loop, but do have a few lined up for the high-priority one.
Thread deferral from interrupt is a very common driver requirement, and the high-priority one can also be a replacement for the deprecated RtosTimer.
Sorry about being late,
This looks great! Using static function variables is a solid approach that removes a lot of concerns with the gc, and this looks like a very clean implementation.
referenced this pull request
Jul 17, 2017
1 similar comment
It wasn't working reliably because I wasn't aligning the stack block.
Corrected, and took the opportunity to adjust Thread and EventQueue prototypes so I didn't have to put in pointless casts to
If you don't fancy that change, I can drop them and put in the casts.