11685 Commits

Author SHA1 Message Date
Andrew Kelley
bdf463bee2 std.Io.net: partially implement HostName.lookup 2025-10-02 16:30:59 -07:00
Andrew Kelley
07cc4077fb add some networking 2025-10-02 16:30:59 -07:00
Andrew Kelley
f680c095bd add std.testing.io 2025-10-02 16:30:59 -07:00
Andrew Kelley
2746239fd3 std.Io: delete asyncParallel 2025-10-02 16:30:59 -07:00
Andrew Kelley
25b2954c0c std.Io: fix error handling and asyncParallel docs 2025-10-02 16:30:59 -07:00
Andrew Kelley
9fd1ecb348 std.Io: add asyncConcurrent and asyncParallel 2025-10-02 16:30:59 -07:00
Andrew Kelley
ba51b392e6 std.Io.EventLoop: add aarch64 support 2025-10-02 16:30:59 -07:00
Andrew Kelley
f0499abd88 std.Io.ThreadPool: fix asyncDetached 2025-10-02 16:30:59 -07:00
Andrew Kelley
806214797a 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-02 16:30:59 -07:00
Andrew Kelley
9a62dc4d89 revert std.Thread.Pool for now
and move the Io impl to a separate file
2025-10-02 16:30:59 -07:00
Andrew Kelley
fdd59f0fa7 update to sync with master 2025-10-02 16:30:59 -07:00
Andrew Kelley
0c0ea7844e Io: update for new linked list API 2025-10-02 16:30:59 -07:00
Andrew Kelley
61c38d77c6 std.Io: remove @ptrCast workarounds
thanks to d53cc5e5b2ac51793ea19a847d8cee409af1dee3
2025-10-02 16:30:59 -07:00
Andrew Kelley
0c1e102e97 std.Io.EventLoop: implement select 2025-10-02 16:30:59 -07:00
Andrew Kelley
b4fb7df140 Io.EventLoop: select stub 2025-10-02 16:30:59 -07:00
Andrew Kelley
4a3ef0f779 introduce Io.select and implement it in thread pool 2025-10-02 16:30:59 -07:00
Jacob Young
6ba65ca972 Io.Condition: implement full API 2025-10-02 16:30:59 -07:00
Jacob Young
b174777437 EventLoop: implement detached fibers 2025-10-02 16:30:59 -07:00
Andrew Kelley
5c4ddb8d35 EventLoop: let the allocator do its job
to bucket and free fiber allocations
2025-10-02 16:30:59 -07:00
Jacob Young
c8950b5dd5 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-02 16:30:59 -07:00
Jacob Young
5952fc2c73 EventLoop: revert incorrect optimization 2025-10-02 16:30:59 -07:00
Andrew Kelley
34e85db4a2 EventLoop: remove broken mechanism for making deinit block on detached 2025-10-02 16:30:59 -07:00
Andrew Kelley
e5b2df0c9b std.Io.Condition: change primitive to support only one
and no timer
2025-10-02 16:30:59 -07:00
Andrew Kelley
63b3a3d11c EventLoop: take DetachedClosure into account when allocating 2025-10-02 16:30:59 -07:00
Andrew Kelley
663611773c EventLoop: implement detached async
data races on deinit tho
2025-10-02 16:30:59 -07:00
Jacob Young
0f083f24ff Io: implement faster mutex 2025-10-02 16:30:59 -07:00
Andrew Kelley
0086d315f5 std.Io: add detached async 2025-10-02 16:30:59 -07:00
Andrew Kelley
5508b4c887 implement Mutex, Condition, and Queue 2025-10-02 16:30:59 -07:00
Jacob Young
b01244d225 Io: implement sleep and fix cancel bugs 2025-10-02 16:30:59 -07:00
Jacob Young
b37126bc08 EventLoop: implement thread-local queues and cancellation 2025-10-02 16:30:59 -07:00
Andrew Kelley
c278830592 std.Io: introduce cancellation 2025-10-02 16:30:59 -07:00
Andrew Kelley
79e278f6a2 better API for Io.async 2025-10-02 16:30:59 -07:00
Jacob Young
708bac1a57 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-02 16:30:59 -07:00
Jacob Young
507f973b5e 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-02 16:30:59 -07:00
Andrew Kelley
b215ddc9fb WIP 2025-10-02 16:30:59 -07:00
Andrew Kelley
be68b28b9b start adding fs functions to std.Io 2025-10-02 16:30:59 -07:00
Andrew Kelley
5be0d0b48c free freeing wrong amount in thread pool impl 2025-10-02 16:30:59 -07:00
Jacob Young
2f2019645c 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-02 16:30:59 -07:00
Jacob Young
dfbf68e5fa 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-02 16:30:59 -07:00
Andrew Kelley
3ee2399630 update threaded fibers impl to actually storing args
sorry, something still not working correctly
2025-10-02 16:30:59 -07:00
Andrew Kelley
acd02e978b fix context passing in threaded Io impl 2025-10-02 16:30:59 -07:00
Jacob Young
1e79f2c12f EventLoop: implement main idle fiber 2025-10-02 16:30:59 -07:00
Jacob Young
2c1ceb4c9c EventLoop: add threads 2025-10-02 16:30:59 -07:00
Jacob Young
19e7613a2d EventLoop: rewrite context switching 2025-10-02 16:30:59 -07:00
Jacob Young
a9723598d7 EventLoop: prepare for threading 2025-10-02 16:30:59 -07:00
Andrew Kelley
1e09d7f499 demo: single-threaded green threads implementation 2025-10-02 16:30:59 -07:00
Andrew Kelley
cfb3581fb9 make thread pool satisfy async/await interface 2025-10-02 16:30:59 -07:00
Andrew Kelley
63c554d5a7 introduce std.Io interface
which is planned to have all I/O operations in the interface, but for
now has only async and await.
2025-10-02 16:30:59 -07:00
Alex Rønne Petersen
a4f95b1e61
std.debug.Dwarf.Unwind: deal with invalid def_cfa_reg by GNU toolchains 2025-10-02 15:27:35 +02:00
Alex Rønne Petersen
97de46dc16
std.debug: add riscv32-linux and riscv64-linux unwind support 2025-10-01 23:47:47 +02:00