aboutsummaryrefslogtreecommitdiffstats
path: root/src/logging_systemd.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-09-29 11:32:35 +0200
committerHarald Welte <laforge@osmocom.org>2021-02-03 14:56:17 +0100
commit4fc0add64558ac5935b712d1bec39a473e6ca4f9 (patch)
tree0a4ff294a99a2e0d1d4ebadd07153a24b2256180 /src/logging_systemd.c
parente01de122c13247fb90fdae9531aa00f729f3099a (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 'src/logging_systemd.c')
0 files changed, 0 insertions, 0 deletions