Repository navigation
feat: add Windows IOCP async file I/O in fast_io crate - #3299
Merged
Merged
Conversation
Add I/O Completion Ports support as the Windows equivalent of Linux io_uring. Mirrors the io_uring architecture: feature-gated real module on Windows, stub module on other platforms. - completion_port.rs: RAII wrapper around IOCP handle - overlapped.rs: pinned OVERLAPPED + buffer for stable async pointers - file_reader.rs: overlapped ReadFile with batched concurrent reads - file_writer.rs: overlapped WriteFile with internal buffering - file_factory.rs: factory pattern with auto-fallback to std I/O - config.rs: runtime IOCP detection with AtomicU8 caching - iocp_stub.rs: full API mirror returning Unsupported on non-Windows - IocpPolicy enum (Auto/Enabled/Disabled) matching IoUringPolicy - IOCP_MIN_FILE_SIZE (64KB) threshold for async benefit
- Remove unused import std::os::windows::io::AsRawHandle in file_reader - Remove unnecessary mut on writer variable in file_writer - Allow dead_code on valid_bytes field and buffer_capacity/set_offset methods in overlapped.rs (public API for future callers)
oferchen
added a commit
that referenced
this pull request
May 1, 2026
* feat: add Windows IOCP async file I/O in fast_io crate Add I/O Completion Ports support as the Windows equivalent of Linux io_uring. Mirrors the io_uring architecture: feature-gated real module on Windows, stub module on other platforms. - completion_port.rs: RAII wrapper around IOCP handle - overlapped.rs: pinned OVERLAPPED + buffer for stable async pointers - file_reader.rs: overlapped ReadFile with batched concurrent reads - file_writer.rs: overlapped WriteFile with internal buffering - file_factory.rs: factory pattern with auto-fallback to std I/O - config.rs: runtime IOCP detection with AtomicU8 caching - iocp_stub.rs: full API mirror returning Unsupported on non-Windows - IocpPolicy enum (Auto/Enabled/Disabled) matching IoUringPolicy - IOCP_MIN_FILE_SIZE (64KB) threshold for async benefit * fix: add Send impls for IOCP reader/writer and fix overlapped offset types * fix: resolve Windows clippy warnings in IOCP module - Remove unused import std::os::windows::io::AsRawHandle in file_reader - Remove unnecessary mut on writer variable in file_writer - Allow dead_code on valid_bytes field and buffer_capacity/set_offset methods in overlapped.rs (public API for future callers)
4 of 7 tasks
oferchen
added a commit
that referenced
this pull request
May 5, 2026
* feat: add Windows IOCP async file I/O in fast_io crate Add I/O Completion Ports support as the Windows equivalent of Linux io_uring. Mirrors the io_uring architecture: feature-gated real module on Windows, stub module on other platforms. - completion_port.rs: RAII wrapper around IOCP handle - overlapped.rs: pinned OVERLAPPED + buffer for stable async pointers - file_reader.rs: overlapped ReadFile with batched concurrent reads - file_writer.rs: overlapped WriteFile with internal buffering - file_factory.rs: factory pattern with auto-fallback to std I/O - config.rs: runtime IOCP detection with AtomicU8 caching - iocp_stub.rs: full API mirror returning Unsupported on non-Windows - IocpPolicy enum (Auto/Enabled/Disabled) matching IoUringPolicy - IOCP_MIN_FILE_SIZE (64KB) threshold for async benefit * fix: add Send impls for IOCP reader/writer and fix overlapped offset types * fix: resolve Windows clippy warnings in IOCP module - Remove unused import std::os::windows::io::AsRawHandle in file_reader - Remove unnecessary mut on writer variable in file_writer - Allow dead_code on valid_bytes field and buffer_capacity/set_offset methods in overlapped.rs (public API for future callers)
3 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
fast_iocrate#[cfg(all(target_os = "windows", feature = "iocp"))]), stub module on other platformsIocpPolicyenum (Auto/Enabled/Disabled)New files
crates/fast_io/src/iocp/- Real IOCP module (completion_port, config, file_factory, file_reader, file_writer, overlapped)crates/fast_io/src/iocp_stub.rs- Full API mirror for non-WindowsTest plan