[riot-notifications] [RIOT-OS/RIOT] sys/event: Allow single event_thread handling all queues (#15471)
notifications at github.com
Wed Nov 18 20:59:05 CET 2020
### Contribution description
Allow using `event_loop_multi()` to handle event queues of multiple priorities in an single thread. In the extreme case, all three event queues are handled by a single thread (thus saving two stacks). This comes for the price of increased worst case latency, as already running event handlers will no longer be preempted by higher priority events.
With this, all three event queue priorities are always provided. Using modules, the old behavior of one thread per event queue can be restored for better worst case latency at the expense of additional thread size.
See the added documentation on how to configure if the three priority queues should be handled by one, two, or three threads.
### Testing procedure
The old test (which, btw, was a bit spiced up) should still work and a new test (mostly copy-pasted from the old one) is provided specifically for the case of a single thread handling all queues.
### Issues/PRs references
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* tests/event_threads: spice up test a bit
* sys/event: Allow shared thread for multiple queues
* tests: Add event_thread tests for shared thread
-- File Changes --
M sys/event/thread.c (90)
M sys/include/event.h (5)
M sys/include/event/thread.h (86)
A tests/event_thread_shared/Makefile (5)
A tests/event_thread_shared/main.c (59)
A tests/event_thread_shared/tests/01-run.py (16)
M tests/event_threads/main.c (4)
M tests/event_threads/tests/01-run.py (4)
-- Patch Links --
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications