diff options
author | Harald Welte <laforge@osmocom.org> | 2020-09-29 11:32:35 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2021-02-03 14:56:17 +0100 |
commit | 4fc0add64558ac5935b712d1bec39a473e6ca4f9 (patch) | |
tree | 0a4ff294a99a2e0d1d4ebadd07153a24b2256180 /COPYING | |
parent | e01de122c13247fb90fdae9531aa00f729f3099a (diff) |
logging: Attempt a synchronous, non-blocking write first (file, stderr)
In the old days, we performed synchronous, blocking writes to the log
file or stderr. This was replaced by code that turned all log
file/stderr writes into non-blocking writes behind a write_queue.
This patch now introduces a further optimization: If we currently
don't have any log messages pending in the write queue, we are not
back-logged and assume we have a fair chance of writing the log message
right now, synchronously. So we try that first, and only enqueue
the log message if the write fails (no bytes or insufficient number
of bytes written).
This way we should get the best of both worlds: No delay/re-ordering
(and lower select syscall load) for the "normal" case (benefits of
the old synchronous writes) while at the same time never risking to
block on log output.
Related: OS#4311
Change-Id: I08469a7e4be9bc5bbd39140457bb582f4a0b1703
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions