Non-blocking pipes still appear to be isBlocking

Alan Bateman Alan.Bateman at oracle.com
Wed Jan 31 11:21:49 UTC 2024



On 31/01/2024 01:34, Charles Oliver Nutter wrote:
> :
> On Tue, Jan 30, 2024 at 1:12 AM Alan Bateman<Alan.Bateman at oracle.com>  wrote:
>> The pipe channel could be changed to work like the network channels and change it lazily,
> It occurred to me that this would actually fix my problem very neatly.
> The child side of the pipes would never be used from the parent, so
> they would propagate with default blocking status. The parent streams
> would be blocking until used from a vthread... or more likely, until
> JRuby explicitly sets them nonblocking to match CRuby).
Also if explicitly configured to non-blocking via 
configureBlocking(false), which code executing in any Thread can do. 
Maybe doesn't arise in this user's environment but if you are use 
posix_spawn directly then it's always been possible to have the child 
inherit pipe sockets that were set to non-blocking in the parent.

That said, there isn't any reason to do have the pipe channels work like 
the network channels and do it lazily. I have a draft PR [1] that does 
this and will mull it over next week.

-Alan


[1] https://github.com/openjdk/jdk/pull/17648

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240131/b008947c/attachment-0001.htm>


More information about the loom-dev mailing list