Skip to content

WIP: add absolute timed wait to CV#20

Draft
ysbaddaden wants to merge 2 commits intomainfrom
feature/add-timed-wait-to-cv
Draft

WIP: add absolute timed wait to CV#20
ysbaddaden wants to merge 2 commits intomainfrom
feature/add-timed-wait-to-cv

Conversation

@ysbaddaden
Copy link
Owner

@ysbaddaden ysbaddaden commented Aug 28, 2025

First attempt at adding timed waits to Sync::CV so we can at most wait until some absolute monotonic deadline. Roughly follows the nsync algorithm though the wake/timeout semantics are different regarding crystal fibers (than system thread semaphores/futexes).

Untested. Probably doesn't even compile. I think I got the logic right eventually, but I still need some more passes with a refreshed 🧠. Compiles and basic tests pass, but I eventually get a reproducible segfault so the logic ain't sound 💥

Depends on RFC 0014 and crystal-lang/crystal#16070.

TODO:

@ysbaddaden ysbaddaden self-assigned this Aug 28, 2025
@ysbaddaden ysbaddaden added the enhancement New feature or request label Aug 28, 2025
@ysbaddaden ysbaddaden force-pushed the feature/add-timed-wait-to-cv branch from 82cbfe7 to b77cbee Compare August 29, 2025 14:50
@ysbaddaden ysbaddaden force-pushed the main branch 2 times, most recently from a09c9ef to d0d7cb3 Compare October 31, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant