diff options
| author | David Lamparter <equinox@diac24.net> | 2020-04-07 15:41:04 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2020-04-07 15:41:04 +0200 |
| commit | 6c19e557a59c9301db3981eff40867be347dfb74 (patch) | |
| tree | cc3f276b9e4dfb6036478b8fe11e1c90aea7a0cb | |
| parent | 8d0a2918e8c517731b4b71a4d9f40693938e6385 (diff) | |
doc: logging: clarify per-thread buffering
Log buffer flushing is thread-local.
Signed-off-by: David Lamparter <equinox@diac24.net>
| -rw-r--r-- | doc/developer/logging.rst | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/developer/logging.rst b/doc/developer/logging.rst index 69c385e2f1..0430ad72a3 100644 --- a/doc/developer/logging.rst +++ b/doc/developer/logging.rst @@ -251,8 +251,12 @@ message buffers in order to improve logging performance. The following rules apply for this buffering: * Only messages of priority *DEBUG* or *INFO* are buffered. -* Any higher-priority message causes the entire buffer to be flushed, thus - message ordering is preserved properly. +* Any higher-priority message causes the thread's entire buffer to be flushed, + thus message ordering is preserved on a per-thread level. +* There is no guarantee on ordering between different threads; in most cases + this is arbitrary to begin with since the threads essentially race each + other in printing log messages. If an order is established with some + synchronization primitive, add calls to :c:func:`zlog_tls_buffer_flush()`. * The buffers are only ever accessed by the thread they are created by. This means no locking is necessary. |
