core: merge msg
into mbox
#10399
Labels
Area: core
Area: RIOT kernel. Handle PRs marked with this with care!
Discussion: RFC
The issue/PR is used as a discussion starting point about the item of the issue/PR
State: stale
State: The issue / PR has no activity for >185 days
Type: enhancement
The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
From my understanding there is some shared functionality between the asynchronous behavior of
core_msg
andcore_mbox
: messages are put into a queue by n threads and gotten out n threads. In case ofcore_msg
n is however one.On one hand side we might get some code size benefits in merging the two, on the other we would put some more complexity into the asynchronous behavior of
core_msg
, since it isn't required to handle more than one reception thread.A good compromise in my opinion would be to provide an new
mbox
implementation that assumes only one reader and base the oldmbox
andmsg
implementation on it. I started something into that direction in this branch. But Imsg
yetRIOT/core/mbox_base.c
Lines 63 to 66 in 1631d29
RIOT/core/mbox_base.c
Lines 92 to 96 in 1631d29
_mbox_base_put()
andmbox_base_get()
would be called by the wrapper implementations ofmbox
andmsg
, both might have their ownirqstate
stored (and thus it might not properly return to the right IRQ state in both_mbox_base_wait()
and_mbox_base_notify()
.The text was updated successfully, but these errors were encountered: