Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Yes, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: