Skip to content

Default to nonblocking whenever possible#7466

Open
headius wants to merge 1 commit intojruby:masterfrom
headius:nonblock_default
Open

Default to nonblocking whenever possible#7466
headius wants to merge 1 commit intojruby:masterfrom
headius:nonblock_default

Conversation

@headius
Copy link
Member

@headius headius commented Nov 21, 2022

Ruby 3.0 began to set O_NONBLOCK by default for all IO, to allow more IO types to enlist in the new IO/fiber scheduling. JRuby has not previously defaulted to nonblock, but all IO operations against nonblock-compatible channels does use nonblocking semantics, so all we really need to align with CRuby is to just set them non-blocking at the NIO level on creation.

We can only do this when the underlying channel supports nonblocking semantics, but this commit attempts to set such channels up properly.

Part of scheduler work in #7459 and related issues.

@headius headius added this to the JRuby 9.4.1.0 milestone Nov 21, 2022
@headius
Copy link
Member Author

headius commented Feb 6, 2023

This is less of a concern given our native threads but ideally we still should do it. Need to reexamine this for 9.4.2.

@headius headius modified the milestones: JRuby 9.4.1.0, JRuby 9.4.2.0 Feb 6, 2023
@headius headius modified the milestones: JRuby 9.4.2.0, JRuby 9.4.3.0 Feb 28, 2023
Ruby 3.0 began to set O_NONBLOCK by default for all IO, to allow more IO
types to enlist in the new IO/fiber scheduling. JRuby has not previously
defaulted to nonblock, but all IO operations against nonblock-compatible
channels does use nonblocking semantics, so all we really need to align
with CRuby is to just set them non-blocking at the NIO level on
creation.

We can only do this when the underlying channel supports
nonblocking semantics, but this commit attempts to set such
channels up properly.

Part of scheduler work in jruby#7459 and related issues.
@headius headius force-pushed the nonblock_default branch from adc8055 to 0acfadf Compare May 23, 2023 14:56
@headius headius modified the milestones: JRuby 9.4.3.0, JRuby 9.4.4.0 May 23, 2023
@headius
Copy link
Member Author

headius commented Oct 11, 2023

Do this whenever #7944 lands.

@headius headius modified the milestones: JRuby 9.4.4.0, JRuby 9.4.5.0 Oct 11, 2023
@enebo enebo modified the milestones: JRuby 9.4.5.0, JRuby 9.4.6.0 Oct 31, 2023
@headius headius modified the milestones: JRuby 9.4.6.0, JRuby 9.5.0.0 Feb 9, 2024
@headius headius changed the base branch from master to 10-dev November 11, 2024 19:27
@headius headius changed the base branch from 10-dev to master March 10, 2025 22:09
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