Oh neat, just realized `log` + `bumpalo` probably work really well together! Each time a message is created it can be stored in the bump allocator. Then every n messages, or when `Log::flush` is called we take a lock on stdout, write all messages, and reset the allocator!
-
-
This thing comes to mind: https://github.com/japaric/cortex-m-funnel … It creates an SPSC logging queue for each interrupt level (~ thread), and the idle loop is expected to drain each one. This keeps everything lockless even when the hardware has no atomics.
-
Ohh, yes of course! Should be fairly straight forward to build with crossbeam's queues! Out of curiosity: what do you mean by "idle loop" here?
- 2 more replies
New conversation -
-
-
I think
@mycoliza basically already wrote this for tracinghttps://github.com/hawkw/sharded-slab … -
Its not a bump allocator tho, just an allocation pool, so flushing doesn't release the allocation.
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.