Change in libosmocore[master]: logging: Attempt a synchronous, non-blocking write first (file, stderr)

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Sep 30 07:39:35 UTC 2020


Hello Jenkins Builder, 

I'd like you to reexamine a change. Please visit

    https://gerrit.osmocom.org/c/libosmocore/+/20317

to look at the new patch set (#2).

Change subject: logging: Attempt a synchronous, non-blocking write first (file, stderr)
......................................................................

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.

Change-Id: I08469a7e4be9bc5bbd39140457bb582f4a0b1703
---
M src/logging.c
1 file changed, 30 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/20317/2
-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20317
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I08469a7e4be9bc5bbd39140457bb582f4a0b1703
Gerrit-Change-Number: 20317
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200930/51da2ab3/attachment.htm>


More information about the gerrit-log mailing list