Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6a7c5aa
Add io_uring futex support
samuel-williams-shopify Aug 21, 2026
14567c1
Allow multiple futexes per buffer
samuel-williams-shopify Aug 21, 2026
16deb45
Add vector and blocking futex waits
samuel-williams-shopify Aug 21, 2026
55f477d
Fix futex waitv method arity
samuel-williams-shopify Aug 21, 2026
fbb023b
Separate the Linux futex implementation
samuel-williams-shopify Aug 21, 2026
92714eb
Retain futex values and cover debug forwarding
samuel-williams-shopify Aug 21, 2026
f66ed50
Use Ubuntu 26.04 for futex tests
samuel-williams-shopify Aug 21, 2026
1fd0246
Add futex atomic operations
samuel-williams-shopify Aug 21, 2026
96f6a30
Update .github/workflows/test-futex.yaml
samuel-williams-shopify Aug 21, 2026
577decd
Fix Futex test formatting
samuel-williams-shopify Aug 30, 2026
c1917cc
Retain counted buffer locks for Futex lifetimes
samuel-williams-shopify Sep 24, 2026
14c1cf6
Add a dedicated Futex notifications guide
samuel-williams-shopify Sep 24, 2026
c2bdc44
Require an explicit expected value for Futex waits
samuel-williams-shopify Sep 24, 2026
0b662f6
Restore spacing between release notes
samuel-williams-shopify Sep 24, 2026
67f72a6
Remove redundant Futex platform absence test
samuel-williams-shopify Sep 24, 2026
cc118e8
Run Futex CI through a local Bake task
samuel-williams-shopify Sep 24, 2026
b07d8df
Run Futex checks in the main test workflow
samuel-williams-shopify Sep 24, 2026
141c4b5
Exercise Futex in the regular Linux head test matrix
samuel-williams-shopify Sep 24, 2026
8aea891
Document temporary Ubuntu 26.04 pin for Futex coverage
samuel-williams-shopify Sep 24, 2026
54d2534
Keep the Futex guide focused on usage
samuel-williams-shopify Sep 24, 2026
9944c6d
Separate single and vector Futex wait state
samuel-williams-shopify Sep 24, 2026
ea69560
Make zero-count Futex wake and signal no-ops
samuel-williams-shopify Sep 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ permissions:
jobs:
test:
name: ${{matrix.ruby}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
runs-on: ${{matrix.os}}
continue-on-error: ${{matrix.experimental}}

strategy:
matrix:
os:
- ubuntu
- macos
- windows
- ubuntu-latest
- macos-latest
- windows-latest

ruby:
- "3.3"
Expand All @@ -26,13 +26,15 @@ jobs:
experimental: [false]

include:
- os: ubuntu
- os: ubuntu-latest
ruby: truffleruby
experimental: true
- os: ubuntu
- os: ubuntu-latest
ruby: jruby
experimental: true
- os: ubuntu
# Use newer packaged liburing for Futex coverage on Ruby head.
# Switch back to ubuntu-latest after its 26.04 rollout (2026-11-19).
- os: ubuntu-26.04
ruby: head
experimental: true

Expand All @@ -44,8 +46,8 @@ jobs:
bundler-cache: true

- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu'
run: sudo apt-get install -y liburing-dev
if: startsWith(matrix.os, 'ubuntu-')
run: sudo apt-get update && sudo apt-get install -y liburing-dev

- name: Run tests
timeout-minutes: 10
Expand Down
9 changes: 7 additions & 2 deletions ext/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@

have_func("rb_ext_ractor_safe")
have_func("&rb_fiber_transfer")
have_io_buffer = have_header("ruby/io/buffer.h")

if RUBY_PLATFORM.include?("linux") && have_io_buffer && have_header("linux/futex.h") && have_header("sys/syscall.h")
$srcs << "io/event/futex.c"
end

if have_library("uring") and have_header("liburing.h")
have_func("io_uring_prep_waitid", "liburing.h")
have_func("io_uring_prep_futex_wait", "liburing.h")
have_func("io_uring_prep_futex_waitv", "liburing.h")
$srcs << "io/event/selector/uring.c"
end

Expand All @@ -57,8 +64,6 @@
have_func("&rb_fiber_raise")
have_func("epoll_pwait2(0, 0, 0, 0, 0)", "sys/epoll.h") if enable_config("epoll_pwait2", true)

have_header("ruby/io/buffer.h")

# Feature detection for blocking operation support
if have_func("rb_fiber_scheduler_blocking_operation_extract")
# Feature detection for pthread support (needed for WorkerPool)
Expand Down
5 changes: 5 additions & 0 deletions ext/io/event/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "event.h"
#include "fiber.h"
#include "futex.h"
#include "selector/selector.h"

void Init_IO_Event(void)
Expand All @@ -15,6 +16,10 @@ void Init_IO_Event(void)

Init_IO_Event_Fiber(IO_Event);

#ifdef IO_EVENT_FUTEX
Init_IO_Event_Futex(IO_Event);
#endif

#ifdef HAVE_IO_EVENT_WORKER_POOL
Init_IO_Event_WorkerPool(IO_Event);
#endif
Expand Down
Loading
Loading