2 ms·
Well, yeah, it depends on what you want to log. > collect all the buffers Which requires some sort of synchronization (or lock-free data structures), because
by layer8 1y ago
Well, yeah, it depends on what you want to log.
> collect all the buffers
Which requires some sort of synchronization (or lock-free data structures), because of concurrent writes by other threads. In that situation, you can also simply use a dedicated thread to periodically flush the log buffers.
- ot 1y agoYes, but crucially, only 1/period, not on every single "should log?" call, which is what I was referring to above. The per-thread mutexes are uncontended virtually all the time.