mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-08 06:24:03 -06:00
queuelogger: Add support for background log writing
Writing to the debug log can cause an unbounded delay due to disk IO. This is particularly so on embedded machines such as the Raspberry Pi that run on SD cards. These log writing delays can cause problems for the main processing threads. The new "queuelogger" code forwards all the main thread log messages to a queue, and a background thread writes the log messages from the queue to the destination file. This eliminates the IO delay from the main threads. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
afecf7ce36
commit
1dee1ba64e
3 changed files with 58 additions and 6 deletions
|
@ -98,9 +98,11 @@ printer object calls, which frequently translate the actions to
|
|||
commands to be executed on the micro-controller (as declared via the
|
||||
DECL_COMMAND macro in the micro-controller code).
|
||||
|
||||
There are three threads in the Klippy host code. The main thread
|
||||
There are four threads in the Klippy host code. The main thread
|
||||
handles incoming gcode commands. A second thread (which resides
|
||||
entirely in the **klippy/serialqueue.c** C code) handles low-level IO
|
||||
with the serial port. The third thread is used to process response
|
||||
messages from the micro-controller in the Python code (see
|
||||
**klippy/serialhdl.py**).
|
||||
**klippy/serialhdl.py**). The fourth thread writes debug messages to
|
||||
the log (see **klippy/queuelogger.py**) so that the other threads
|
||||
never block on log writes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue