You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it would be nice to have a totally-non-allocating MPSC variant for embedded etc where instead of an Arc<ThingBuf<T>> the queue is stored in an &'static ThingBuf<T>. we can now do this even with waiting tasks now that #16 added an intrusive wait queue that doesn't allocate.
i think that the API for this will have to be something like:
staticSOME_QUEUE: thingbuf::StaticMpsc<Event,1024> = thingbuf::StaticMpsc::new();fnmain(){let(tx, rx) = SOME_QUEUE.try_split().expect("queue split into sender/receiver pair more than once");// ...}
because that's the only nice way to get all the important stuff in a static initializer and hand out &'static refs to it to a sender/receiver pair. i don't think we can just add a try_split to the normal StaticThingbuf type since the shared state also needs rx/tx wait cells...
The text was updated successfully, but these errors were encountered:
This branch adds new `StaticChannel` types that can be used to construct
statically allocated MPSC channel variants. The static channels can be
used without requiring *any* heap allocations. This is intended
primarily for embedded systems and bare metal programming where
allocators may not be available or heap memory is constrained.
Closes#17
Signed-off-by: Eliza Weisman <[email protected]>
it would be nice to have a totally-non-allocating MPSC variant for embedded etc where instead of an
Arc<ThingBuf<T>>
the queue is stored in an&'static ThingBuf<T>
. we can now do this even with waiting tasks now that #16 added an intrusive wait queue that doesn't allocate.i think that the API for this will have to be something like:
because that's the only nice way to get all the important stuff in a static initializer and hand out
&'static
refs to it to a sender/receiver pair. i don't think we can just add atry_split
to the normalStaticThingbuf
type since the shared state also needs rx/tx wait cells...The text was updated successfully, but these errors were encountered: