-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
std: Introduce Io Interface
#25592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+17,689
−9,743
Merged
std: Introduce Io Interface
#25592
Changes from all commits
Commits
Show all changes
244 commits
Select commit
Hold shift + click to select a range
21b7316
introduce std.Io interface
andrewrk cb9f9bf
make thread pool satisfy async/await interface
andrewrk 4d56267
demo: single-threaded green threads implementation
andrewrk fe6f1ef
EventLoop: prepare for threading
jacobly0 629a204
EventLoop: rewrite context switching
jacobly0 9d0f44f
EventLoop: add threads
jacobly0 f1dd06b
EventLoop: implement main idle fiber
jacobly0 31ed2d6
fix context passing in threaded Io impl
andrewrk 4c7c0c4
update threaded fibers impl to actually storing args
andrewrk 29355ff
EventLoop: fix incorrect alignment panic
jacobly0 1493c3b
EventLoop: move context after the async closure
jacobly0 08bb7c6
free freeing wrong amount in thread pool impl
andrewrk 66b0f7e
start adding fs functions to std.Io
andrewrk 238de05
WIP
andrewrk db0dd3a
EventLoop: get file operations working
jacobly0 d958077
EventLoop: fix futex usage
jacobly0 a29b212
better API for Io.async
andrewrk e7caf3a
std.Io: introduce cancellation
andrewrk 5041c9a
EventLoop: implement thread-local queues and cancellation
jacobly0 08b609a
Io: implement sleep and fix cancel bugs
jacobly0 0d4b358
implement Mutex, Condition, and Queue
andrewrk a1c1d06
std.Io: add detached async
andrewrk f84aca3
Io: implement faster mutex
jacobly0 266bcfb
EventLoop: implement detached async
andrewrk 8773b63
EventLoop: take DetachedClosure into account when allocating
andrewrk 929b616
std.Io.Condition: change primitive to support only one
andrewrk 4063205
EventLoop: remove broken mechanism for making deinit block on detached
andrewrk e366b13
EventLoop: revert incorrect optimization
jacobly0 08ce000
EventLoop: fix `std.Io.Condition` implementation
jacobly0 0f105a8
EventLoop: let the allocator do its job
andrewrk 3eb7be5
EventLoop: implement detached fibers
jacobly0 c4fcf85
Io.Condition: implement full API
jacobly0 7aa4062
introduce Io.select and implement it in thread pool
andrewrk f158ec5
Io.EventLoop: select stub
andrewrk c88b8e3
std.Io.EventLoop: implement select
andrewrk 4b657d2
std.Io: remove `@ptrCast` workarounds
andrewrk e1cbcec
Io: update for new linked list API
andrewrk fd4dd3b
update to sync with master
andrewrk 14c3dc4
revert std.Thread.Pool for now
andrewrk f5d8492
std.Io: rename go to asyncDetached
andrewrk 30be75c
std.Io.ThreadPool: fix asyncDetached
andrewrk ec3e4c0
std.Io.EventLoop: add aarch64 support
andrewrk f762597
std.Io: add asyncConcurrent and asyncParallel
andrewrk 7ead86e
std.Io: fix error handling and asyncParallel docs
andrewrk 84d6040
std.Io: delete asyncParallel
andrewrk d801a71
add std.testing.io
andrewrk 668f905
add some networking
andrewrk bd3c65f
std.Io.net: partially implement HostName.lookup
andrewrk e7729a7
std: start moving fs.File to Io
andrewrk b4e5e9d
Io.net: implement sortLookupResults
andrewrk fc1e3d5
Io.net: partial implementation of dns lookup
andrewrk 0e9280e
std.Io: extract Dir to separate file
andrewrk 5089352
std.Io: rename ThreadPool to Threaded
andrewrk d776a6b
Io.net: rework IPv6 parsing and printing
andrewrk e7c9df9
Io.net: use resolve for IPv6
andrewrk 885b3f8
Io.net: finish implementing IPv6 parsing
andrewrk 5782158
std.net: fix parsing IPv6 addr "::"
andrewrk 8771a9f
std.Io.net: progress towards DNS resolution
andrewrk 60c4bdb
Io.net: implement more networking
andrewrk f9d976a
std.Io: rename asyncConcurrent to concurrent
andrewrk 5469db6
std.Thread.ResetEvent: make it more reusable
andrewrk 8e1da66
std.Io: implement Group API
andrewrk 2e1ab5d
std.Io.Threaded: implement Group.cancel
andrewrk b224002
std.Io.net.HostName: finish implementing DNS lookup
andrewrk cde5a51
std.Io.net: make netSend support multiple messages
andrewrk 3b80fde
std.os.linux: remove sendmmsg workaround
andrewrk bcb6760
std.os.linux: remove unnecessary warnings from sendmmsg
andrewrk 95dee2a
std.Io: implement netSend
andrewrk 961961c
std: fix msghdr and cmsghdr when using musl libc
andrewrk a6347a6
std.Io.net: implement receiving connectionless messages
andrewrk 62d0dd0
std.Io.Threaded.netReceive: recvmsg first, then poll
andrewrk f1a590c
std.Io.net.HostName: implement DNS reply parsing
andrewrk 85a6fea
std.Io.net.HostName: implement DNS name expansion
andrewrk 00f26cb
WIP land the std.Io interface
andrewrk 774df26
WIP: hack at std.Io on a plane
andrewrk b428612
WIP: hack away at std.Io return flight
andrewrk 066864a
std.zig.system: upgrade to std.Io.Reader
andrewrk 47aa5a7
std: updating to std.Io interface
andrewrk 69b54b0
remove bad assert
andrewrk 89412fd
std.Io: implement fileStat
andrewrk ebcc6f1
std.Io: bring back Timestamp but also keep Clock.Timestamp
andrewrk e85df85
std.mem: improve containsAtLeastScalar implementation and rename
andrewrk eadfefa
std.Io: implement dirMake
andrewrk 750b143
std: fix some Io compilation errors
andrewrk 8a1e6c8
std.Io: implement dirStatPath
andrewrk b1733b7
std.Io: implement dirOpenFile
andrewrk 7d47811
fix compilation errors introduced by rebasing
andrewrk fcac861
Add missing clobbers to context switching
lalinsky 63801c4
std.crypto.Certificate.Bundle: remove use of File.readAll
andrewrk 9e681ca
std.Uri: fix compilation error
andrewrk 3b34622
std.Io: add unix domain sockets API
andrewrk d408032
progress towards compiler building again
andrewrk 71ff6e0
std: fix seekBy unit test
andrewrk be1ae43
std.Io.Threaded.netReadPosix: support cancelation
andrewrk 4d62f08
add BRANCH_TODO file
andrewrk e0e463b
std.Io.net.Stream.Reader: fix not using buffer
andrewrk 923a7bd
std.Io.net: fix parsing IPv4-mapped IPv6 addresses
andrewrk d3f0c46
std.Io.net.HostName: fix DNS resolution
andrewrk 5398082
std.net: IPv6 parsing fixes
andrewrk d680b9e
std.Io.File: add WouldBlock to the error set
andrewrk e8cea8a
std.Io.Threaded: implement netListenUnix
andrewrk 0732ff2
std.Io.Threaded: implement connecting to unix sockets
andrewrk 79a59c5
coff linker: don't check the time
andrewrk c2d1a33
std.fs.File: begrudgingly add back deprecated APIs
andrewrk 2bcdde2
compiler: update for introduction of std.Io
andrewrk 1382e41
std.Io.Threaded: import std.Io.net
andrewrk 35ce907
std.Io.net.HostName: move lookup to the interface
andrewrk d3c4158
std.Io: implement Select
andrewrk adaef43
std.net.HostName.connect: rework to avoid waiting for DNS
andrewrk 80069c1
std.Io.Queue: add "uncancelable" variants to "get"
andrewrk 426a377
std.Io.net.Stream: add "const" variant to "close"
andrewrk 870a682
std.Io.net.HostName.connect: fix resource leaks
andrewrk 10bfbd7
std.Io.Threaded: rename from "pool"
andrewrk 060fd97
std.Io.Group: add cancellation support to "wait"
andrewrk 81b1bfb
std.Io.Threaded: wrangle TODOs
andrewrk 1e81c3a
std.Io: rename EventLoop to IoUring
andrewrk bb1bf5b
std.Io: stub file writing rather than incorrect impl
andrewrk f7d47ae
README: LLVM-less builds are more capable now
andrewrk 031044b
std: fix macos compilation errors
andrewrk 18ec968
std.Io.Threaded: add support for getaddrinfo
andrewrk bf841bb
std.Io.Threaded: implement futexes on darwin
andrewrk 90fdd21
std: move DNS record enum to a better namespace
andrewrk 22334f5
std: make IPv6 address parsing system-independent
andrewrk f7bbcb4
fix miscellaneous compilation failures
andrewrk 6336d58
std.Io.Threaded: fix getaddrinfo usage
andrewrk f14c4c3
std.Io.net.HostName: fix connectMany not running DNS async
andrewrk 7b1502f
std: fix compilation errors on macos
andrewrk 3bf0ce6
fix miscellaneous compilation errors
andrewrk f8ea00b
std.Io: add dirAccess
andrewrk ec9dfc5
std.Io.Threaded: handle ECANCELED
andrewrk 1431275
std.Io.Threaded: implement dirMake for WASI
andrewrk d4215ff
std.Io.Threaded: implement dirCreateFile for WASI
andrewrk cf6fa21
std.Io.Threaded: fix netWrite cancellation
andrewrk e87ceb7
std.Io.net.Server: refine AcceptError set
andrewrk da6b959
std.Io.Threaded: implement dirOpenFile for WASI
andrewrk 81e7e9f
std.Io: add dirOpenDir and WASI impl
andrewrk 752d386
std.Io.Threaded: fix -fsingle-threaded build
andrewrk 43c2ba3
std: accessZ -> access
andrewrk 97b9cc0
aro: avoid asking for the time
andrewrk 2d7d98d
std.fs: use BadPathName rather than InvalidWtf8 on Windows
andrewrk 21e195a
std: move some windows path checking logic
andrewrk 83e4ff6
std.Io: add dirClose
andrewrk b215f86
std.Io.net.HostName.ResolvConf: ignore nameservers above max
andrewrk 10b1eef
std: fix compilation errors on Windows
andrewrk ed7747e
std.Io.Threaded: add dirMake for Windows
andrewrk f98352e
std.debug.SelfInfo: add missing io parameter to getSymbol
andrewrk 482343f
std.Io.Threaded: implement dirStatPath for Windows
andrewrk aa6e8ef
std.Io.Threaded: implement dirAccess for Windows
andrewrk b561d5f
std.Io.Threaded: implement dirCreateFile for Windows
andrewrk 1c67607
std.Io.Threaded: implement dirOpenFile for Windows
andrewrk 6d1b2c7
std.Io: introduce openSelfExe
andrewrk 97bde94
compiler: upgrade unit tests to new API
andrewrk 894cb5a
std.posix: untangle getRandomBytesDevURandom from Io.Reader
andrewrk 71c86e1
std.posix: fix compilation on wasm32-freestanding
andrewrk dc6a4f3
std.Io: add dirMakePath and dirMakeOpenPath
andrewrk 62c0496
std.Io.Threaded: implement dirOpenDir
andrewrk 34891b5
std.Io.Threaded: implement netListen for Windows
andrewrk 0b5179a
std.Io.Threaded: implement netAccept for Windows
andrewrk 76107e9
std.Io.Threaded: implement netBindIp for Windows
andrewrk 4174ac1
resinator: update for new Io APIs
andrewrk 67df66c
update some tests and tools for new Io APIs
andrewrk 4ed74a9
std.Io.Threaded: implement netConnectIp for Windows
andrewrk aadd8d4
std: back out the StackTrace byval changes
andrewrk d257b13
std.Io.Threaded: fix compilation failures on Windows
andrewrk 0107e58
std.Io.Threaded: implement Windows futex functions
andrewrk dab8dd5
std.os.windows.ws2_32: remove 'A' variants
andrewrk ab003cd
std.Io.Threaded: implement netLookup for Windows
andrewrk 00a3123
std.process.Child: update for std.Io changes
andrewrk 2f26025
std: fix build failure on wasm32-freestanding
andrewrk a3ddca3
std.Io.Threaded: delete Windows implementation of if_nametoindex
andrewrk 0321524
std.Io.Threaded: fix signature of dirMakeOpenPathWasi
andrewrk 873bcb5
fix some std.Io compilation failures
andrewrk 59ffa60
std.Io.Threaded: fix sending invalid pointer
andrewrk a5c309a
std.Io.net.Socket.send: fix compilation errors
andrewrk d6b0686
std.Io: add Kqueue implementation
andrewrk df84dc1
add bind
andrewrk 4107093
revert adding asyncDetached
andrewrk dd945bf
one kqueue per thread
andrewrk 92b8378
concurrent and await
andrewrk 9d6750f
std.Io.Kqueue: implement netSend
andrewrk f17c6bb
std.Io.Kqueue: implement netConnect
andrewrk 1b0dcd4
std.Io.Threaded: fix setting of O_NONBLOCK flag
andrewrk 0497f88
std.Io.Kqueue: implement netRead
andrewrk cc11dd1
std.Io.Kqueue: implement EAGAIN logic for netRead
andrewrk 6a64c9b
std.Io.Kqueue: add missing Thread deinit logic
andrewrk 5578c76
std.Io.Kqueue: implement wait queue per fd
andrewrk a1f177d
std.Io.Threaded: stub netListenUnix for Windows
andrewrk 89bb58e
incr-check: windows source files depend on ws2_32
andrewrk 5d7672f
std.Io.Threaded: stub netConnectUnix for Windows
andrewrk 5c527a1
std.Io.Threaded: implement fileStat for Windows
andrewrk 701d4bc
objcopy: update for std.Io API
andrewrk 46f7e3e
std.Io.Threaded: add ioBasic which disables networking
andrewrk c87fbd5
std.os.linux.IoUring: use linux msghdr
andrewrk ecdc004
std.Io.net: make it easier to use netReceiveMany correctly
andrewrk ae86c0f
std.Io: adjust concurrent error set
andrewrk e6b4e1a
disable self-hosted wasm test-cases
andrewrk ed7067a
std.Io: more convenient sleep
andrewrk 85e159e
std.Io.Threaded: closures must always be run even when canceled
andrewrk a8f95e5
std.Io.Threaded: implement cancellation for pthreads
andrewrk 6cff32c
std.Io.Threaded: implement netRead for Windows
andrewrk fd7475c
std.Io.Threaded: implement netWrite for Windows
andrewrk f6c5525
std.Io.Threaded: fix compilation on pthreads linux
andrewrk f9de83c
std.Io.net: skip testing netInterfaceNameResolve on Windows
andrewrk 441d0c4
std.Io.net.HostName: fix missing group cancel
andrewrk 6ccb53b
std.Io.Threaded: fix openSelfExe for Windows
andrewrk 0211936
wasm linking: handle unreachable call_indirect
andrewrk df4c30c
link: move the windows kernel bug workaround to Io implementation
andrewrk 0caf286
std.Io.Threaded: don't skip executing canceled group closures
andrewrk a87fd37
std.Io: make Evented equal void when unimplemented
andrewrk 4e95c2e
std.Io.Threaded: implement futexes for freebsd
andrewrk bbc1c07
std.zig.system: fix error set of abiAndDynamicLinkerFromFile
andrewrk ef55dca
start: fix logic for signal hanlding when SIG.POLL does not exist
andrewrk cc751c0
std.Io.Threaded: correct clockToPosix for FreeBSD
andrewrk 8b269f7
std: make signal numbers into an enum
andrewrk 80a341b
std: remove awareness of POLL signal
andrewrk 3de1b6c
std.Io.Threaded: better clock lowering for BSDs
andrewrk c8739d6
std.Io.Group: fix leak when wait is canceled
andrewrk cc4931b
std.Io.Threaded: fix 32-bit overflow in lookupDns
andrewrk 6b8972d
resinator: update for Io API
andrewrk 135ec79
std.Io.File: fix stat for Windows
andrewrk 030ddc7
update standalone tests for ws2_32 dependency
andrewrk 30448d9
std.Io.Threaded: fix netLookup for Windows
andrewrk a28d305
std.Io.Threaded: implement ResetEvent in terms of pthreads
andrewrk c0c2010
std.c: fix msghdr struct on big endian targets
andrewrk 94b9874
std.Io.Threaded: stub out netbsd mutex and condition
andrewrk f5870b2
std.Io.Threaded: fix typo in panic message
andrewrk 4114392
std: fix definition of ws2_32.GetAddrInfoExW
andrewrk b39f3d2
std.Io.Threaded: implement dirMakeOpenPath for WASI
andrewrk c4dc7d7
std.Io.Threaded: implement Unix sockets for Windows
andrewrk 030b630
std.Io.Threaded: fix EBADF error code on wasm32-wasi -lc when reading
andrewrk 1553c8e
std.os.linux.x86: fix signal restore function
andrewrk 6f64c8b
std.debug.SelfInfo.Windows: less invasive change
andrewrk 9f98641
CI: link ws2_32.lib on Windows
andrewrk 6c794ce
std.Io.Threaded.dirOpenFileWtf16: SHARING_VIOLATION
andrewrk 03fd132
std.Io: fix Group.wait unsoundness
andrewrk c40204a
std.Io: add unit tests for Group and concurrent
andrewrk a45cafb
std.Io: add unit test for select
andrewrk 1c0a8b8
std.hash_map: tune slow unit tests
andrewrk b863f25
std.Io.Threaded: handle -fsingle-threaded in unit tests
andrewrk 05b2840
std.Io.Threaded: install and cleanup signal handlers
andrewrk b1d270d
std.os.linux.s390x: fix restore function
andrewrk e8e1e27
std.Io: make select unit test not depend on cancellation
andrewrk 0205ce4
std.os.linux.IoUring: disable failing test
andrewrk 16185f6
std.http: disable failing test on 32-bit arm
andrewrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.