mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 06:09:58 -04:00
Gather the log lines of a quarter of a second and write them at once.
The log thread wrote as soon as it woke, which outside a burst is once for every line: each line woke it and was a write of its own to the log file and the console. It now waits a quarter of a second from the first line it finds, or until the queue is half full, and writes what was queued by then at once, so the log is up to that much behind the game. What is being gathered stays in the queue, so a fatal error, a crash report and an exit write it out before their own lines as before; a game ended from outside loses those last lines. The queue's test checks the gathering, the half-full write and that a process which ends at once, by an exit or as a fatal error does, leaves every line in its file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -373,9 +373,14 @@ A change to the log queue (`runtime/logq.c`) passes `python tests\logq_check.py`
|
||||
layer and a destination of its own: 160,000 lines from eight threads arrive whole and in each thread's order, a line
|
||||
logged while the queue's lock is taken waits and does not pass the lines queued before it, a destination that takes
|
||||
30 ms a write does not hold the threads that log, the line about slow writes comes once in ten seconds, a destination
|
||||
that stops while four times the queue's size is logged loses nothing, and `logq_sync` returns with everything written.
|
||||
The test passes on a busy machine too: it waits for the queue to empty instead of for a time, and counts slow lines
|
||||
instead of timing one. No game files.
|
||||
that stops while four times the queue's size is logged loses nothing, lines logged together are written in one write
|
||||
a quarter of a second after the first and not before, a queue that is half full is written at once, and `logq_sync`
|
||||
returns with everything written, the lines the log thread was still gathering included. The program then runs twice
|
||||
more as a process that logs 200 lines to a file and ends at once, by an exit and as a fatal error does: each file
|
||||
holds every line, and the fatal line last.
|
||||
The test passes on a busy machine too: it waits for the queue to empty instead of for a time, counts slow lines
|
||||
instead of timing one, leaves out a check its own thread was too late for, and tries the half-full write three times.
|
||||
No game files.
|
||||
|
||||
A change to the button prompts (`tools/make_romfs_patches.py --prompts`, `tools/button_icons.py`) passes
|
||||
`.venv-py314\Scripts\python tests\romfs_prompts_test.py`, which runs the tool on a RomFS it makes itself (no game
|
||||
|
||||
Reference in New Issue
Block a user