Skip to content

0.13.3: the environment read from two contexts at once; a pipe's bounded read measured - #37

Merged
Sunrisepeak merged 2 commits into
mainfrom
openkal-windows-0.13.3
Oct 27, 2026
Merged

Sunrisepeak merged 2 commits into
mainfrom
openkal-windows-0.13.3

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Two defects measured through mcpplibs.os and mcpp.

  1. The environment read from two contexts at once. The tables behind openkal.env are filled on the first enquiry, and prepare marked them ready before filling them. Two contexts that asked at the same moment met there: one filled while the other read them empty, so a variable that was set was reported absent. Measured in mcpp's unit test of concurrent launches: of two threads starting hostname and ping together, one found its program "not on PATH". The tables are now filled once under a slim lock (SRWLOCK, static and all-zero), which every caller takes. tests/environment_read_from_two_threads.cpp starts twenty fresh copies, in each of which two contexts released together make the first enquiry; under wine it fails in 3 of 20 copies on 0.13.2 and passes with the fix.
  2. A bounded read of a pipe waited far past its bound. await_pipe counted its Sleep(1) calls as milliseconds, and Sleep(1) lasts until the next tick of the system timer (15.6 ms by default), so a 100 ms bound waited about 1.5 s. Measured through mcpplibs.os: a 100 ms read of standard input received input written 400 ms after it began. The time passed is now read from the performance counter. tests/bounded_read_of_an_idle_pipe.cpp requires a 100 ms read of an idle channel to expire within 400 ms (wine's Sleep(1) is one millisecond, so only a real Windows runner can fail it on 0.13.2).

Co-authored-by: speak-agent 248744407+speak-agent@users.noreply.github.com

Sunrisepeak and others added 2 commits October 27, 2026 15:12
… finding it empty

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
…ng its sleeps

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
@Sunrisepeak Sunrisepeak changed the title 0.13.3: the environment read from two contexts at once 0.13.3: the environment read from two contexts at once; a pipe's bounded read measured Oct 27, 2026
@Sunrisepeak
Sunrisepeak merged commit 6730983 into main Oct 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant