37 Commits

Author SHA1 Message Date
Andrew Kelley
f9d976a4e1 std.Io: rename asyncConcurrent to concurrent 2025-10-29 06:20:48 -07:00
Andrew Kelley
e7729a7b89 std: start moving fs.File to Io 2025-10-29 06:20:48 -07:00
Andrew Kelley
84d60404be std.Io: delete asyncParallel 2025-10-29 06:20:48 -07:00
Andrew Kelley
7ead86e339 std.Io: fix error handling and asyncParallel docs 2025-10-29 06:20:48 -07:00
Andrew Kelley
f762597724 std.Io: add asyncConcurrent and asyncParallel 2025-10-29 06:20:48 -07:00
Andrew Kelley
ec3e4c00c3 std.Io.EventLoop: add aarch64 support 2025-10-29 06:20:48 -07:00
Andrew Kelley
f5d8492b1f std.Io: rename go to asyncDetached
it's a better name because it's more descriptive, not a reference, and
hints that it is less common than async
2025-10-29 06:20:48 -07:00
Andrew Kelley
fd4dd3befb update to sync with master 2025-10-29 06:20:48 -07:00
Andrew Kelley
e1cbcecf89 Io: update for new linked list API 2025-10-29 06:20:48 -07:00
Andrew Kelley
c88b8e3c15 std.Io.EventLoop: implement select 2025-10-29 06:20:48 -07:00
Andrew Kelley
f158ec5530 Io.EventLoop: select stub 2025-10-29 06:20:48 -07:00
Jacob Young
c4fcf85c43 Io.Condition: implement full API 2025-10-29 06:20:48 -07:00
Jacob Young
3eb7be5cf6 EventLoop: implement detached fibers 2025-10-29 06:20:48 -07:00
Andrew Kelley
0f105a8a10 EventLoop: let the allocator do its job
to bucket and free fiber allocations
2025-10-29 06:20:48 -07:00
Jacob Young
08ce000276 EventLoop: fix std.Io.Condition implementation
1. a fiber can't put itself on a queue that allows it to be rescheduled
 2. allow the idle fiber to unlock a mutex held by another fiber by
    ignoring reschedule requests originating from the idle fiber
2025-10-29 06:20:48 -07:00
Jacob Young
e366b13a65 EventLoop: revert incorrect optimization 2025-10-29 06:20:48 -07:00
Andrew Kelley
4063205746 EventLoop: remove broken mechanism for making deinit block on detached 2025-10-29 06:20:48 -07:00
Andrew Kelley
929b616e0f std.Io.Condition: change primitive to support only one
and no timer
2025-10-29 06:20:48 -07:00
Andrew Kelley
8773b63241 EventLoop: take DetachedClosure into account when allocating 2025-10-29 06:20:48 -07:00
Andrew Kelley
266bcfbf2f EventLoop: implement detached async
data races on deinit tho
2025-10-29 06:20:48 -07:00
Jacob Young
f84aca36c3 Io: implement faster mutex 2025-10-29 06:20:48 -07:00
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