path: root/tests/gb
diff options
authorHarald Welte <laforge@osmocom.org>2020-09-29 11:32:35 +0200
committerHarald Welte <laforge@osmocom.org>2021-10-26 17:16:50 +0200
commit78d7367c900114351348e5a1961dd6da58056b9f (patch)
tree79231c3fd0c33cf5d11e92e747737f98bea02a23 /tests/gb
parenta0b57d06885572406943bc42884c2d189d541aee (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 'tests/gb')
0 files changed, 0 insertions, 0 deletions