Skip to content

Add Windows IOCP selector#188

Open
samuel-williams-shopify wants to merge 7 commits into
mainfrom
windows-iocp
Open

Add Windows IOCP selector#188
samuel-williams-shopify wants to merge 7 commits into
mainfrom
windows-iocp

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add an experimental Windows selector backed by IOCP for overlapped operations and wakeups.
  • Support practical socket-oriented io_wait, including a Winsock readiness fallback for writable sockets where IOCP does not provide readiness semantics directly.
  • Wire the Windows selector into the extension build/debug selector wrapper, skip documented Windows readiness edge cases, and disable WorkerPool on Windows because it depends on POSIX pthread semantics.

Windows readiness contract

This is intended as a pragmatic Windows baseline, not perfect POSIX parity. The main supported target is socket scheduling.

  • Disk files and character handles are treated as immediately ready; the actual read/write operation reports real errors.
  • Non-socket writable waits are optimistic, because Windows does not expose a general readiness primitive for arbitrary handles.
  • Pipe-readable waits may use overlapped ReadFile when the handle supports it.
  • Mixed READABLE | WRITABLE waits return any immediately-ready writable/error state first; otherwise the selector arms the readable wait.

Tests

  • bundle exec bake test
  • bundle exec rubocop
  • git diff --check
  • GitHub Actions: Windows MRI 3.3, 3.4, and 4.0 passed on 1a12594.
  • JRuby and TruffleRuby failures are expected current noise.

Comment thread .github/workflows/test.yaml Outdated
Assisted-By: devx/f8e3b994-abf7-4565-a3eb-7b9e5e65cffe
Assisted-By: devx/f8e3b994-abf7-4565-a3eb-7b9e5e65cffe
Assisted-By: devx/f8e3b994-abf7-4565-a3eb-7b9e5e65cffe
Assisted-By: devx/f8e3b994-abf7-4565-a3eb-7b9e5e65cffe
Assisted-By: devx/f8e3b994-abf7-4565-a3eb-7b9e5e65cffe
Assisted-By: devx/f8e3b994-abf7-4565-a3eb-7b9e5e65cffe
Assisted-By: devx/f8e3b994-abf7-4565-a3eb-7b9e5e65cffe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants