Skip to content
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

Default to nonblocking whenever possible #7466

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
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
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.

None yet

2 participants