# Nonblocking Windows Ruby popen? (was: Re: C Threads and Rub

**URL:** <https://www.ruby-forum.com/t/nonblocking-windows-ruby-popen-was-re-c-threads-and-rub/101966>\
**Category:** Ruby\
**Created:** [August 8, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/nonblocking-windows-ruby-popen-was-re-c-threads-and-rub/101966 "2006-08-08T23:03:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [August 8, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/nonblocking-windows-ruby-popen-was-re-c-threads-and-rub/101966/1 "2006-08-08T23:03:40Z")

</div>

From: “Francis C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> > The impression I got from the windows select() documentation  
> > was that it only works with winsock sockets.
> 
> Ruby’s Kernel#select is quite different from the native select. It’s deeply  
> intertwined with the green threads implementation. It basically knows how to  
> handle anything that can be wrapped in a Ruby IO object.

This has been percolating in the back of my mind for a month  
or so now. 🙂

I presume, even though Ruby may be able to handle anything that  
can be wrapped in a Ruby IO object, there’s no implication that  
this object can be handled in a green-thread-friendly way without  
blocking all ruby threads?

I’m currently in search of a green-thread-friendly popen() in  
Windows for Ruby. I just tried the win32-open3 package, but a  
#gets on the pipe still blocks the whole process.

Does anyone know whether a nonblocking popen() is _possible_  
in Windows Ruby? And if so, is there any existing implementation?

If not, what’s the best substitute? All I can think of offhand  
is TCP connections on localhost/loopback.

Thanks,

Regards,

Bill
