16 Commits

Author SHA1 Message Date
Andrew Kelley
0d4b358dd8 implement Mutex, Condition, and Queue 2025-10-29 06:20:48 -07:00
Jacob Young
08b609a79f Io: implement sleep and fix cancel bugs 2025-10-29 06:20:48 -07:00
Jacob Young
5041c9ad9c EventLoop: implement thread-local queues and cancellation 2025-10-29 06:20:48 -07:00
Andrew Kelley
e7caf3a54c std.Io: introduce cancellation 2025-10-29 06:20:47 -07:00
Jacob Young
d958077203 EventLoop: fix futex usage
How silly of me to forget that the kernel doesn't implement its own API.
The scheduling is not great, but at least doesn't deadlock or hammer.
2025-10-29 06:20:47 -07:00
Jacob Young
db0dd3a480 EventLoop: get file operations working
Something is horribly wrong with scheduling, as can be seen in the
debug output, but at least it somehow manages to exit cleanly...
2025-10-29 06:20:47 -07:00
Andrew Kelley
238de05d2c WIP 2025-10-29 06:20:47 -07:00
Jacob Young
1493c3b5f3 EventLoop: move context after the async closure
This avoids needing to store more sizes and alignments.  Only the result
alignment needs to be stored, because `Fiber` is at a fixed zero offset.
2025-10-29 06:20:47 -07:00
Jacob Young
29355ff21c EventLoop: fix incorrect alignment panic
When the previous fiber did not request to be registered as an awaiter,
it may not have actually been a full blown `Fiber`, so only create the
`Fiber` pointer when needed.
2025-10-29 06:20:47 -07:00
Andrew Kelley
4c7c0c4178 update threaded fibers impl to actually storing args
sorry, something still not working correctly
2025-10-29 06:20:47 -07:00
Andrew Kelley
31ed2d6715 fix context passing in threaded Io impl 2025-10-29 06:20:47 -07:00
Jacob Young
f1dd06b01f EventLoop: implement main idle fiber 2025-10-29 06:20:47 -07:00
Jacob Young
9d0f44f08a EventLoop: add threads 2025-10-29 06:20:47 -07:00
Jacob Young
629a20459d EventLoop: rewrite context switching 2025-10-29 06:20:47 -07:00
Jacob Young
fe6f1efde4 EventLoop: prepare for threading 2025-10-29 06:20:47 -07:00
Andrew Kelley
4d56267938 demo: single-threaded green threads implementation 2025-10-29 06:20:47 -07:00