Could use some help from Rust Twitter on this one: I want to provide each thread with a Vec in a thread-local. Then from another thread I want to periodically take ownership of the thread-local vecs and swap them with empty ones. Is there a good pattern/lib for this?
-
-
The goal is to fully amortize the allocation cost of storing log message, while also optimizing for batch writes to e.g. stdout, and reducing the amount of locking to a minimum. Ideally the thread-local bump allocator could be modeled without a Mutex... but mby smth to optimize.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Would it make sense to just have a thread local owned, heap allocated, vec, and when you're done filling it (size or time limited), then push the vec into a channel? Drain the channel from the log emitting thread?
-
Yeah perhaps! -- This sounds similar to what Jakub was suggesting; might give this a shot!https://twitter.com/jakubvaltar/status/1264326532216115203 …
End of conversation
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.