[#7872] Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...>

All, I needed a nonblocking socket connect for my asynchronous-event

18 messages 2006/05/14
[#7873] Re: Nonblocking socket-connect — Tanaka Akira <akr@...17n.org> 2006/05/14

In article <3a94cf510605140559l7baa0205le341dac4f47d424b@mail.gmail.com>,

[#7874] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

How about introducing the method Socket#set_nonblocking, or alternatively

[#7875] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

[#7876] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

Well, it's ok then. I'm comfortable adding in the nonblocking

[#7877] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

Re: Ruby threads working with native threads

From: Eric Hodel <drbrain@...7.net>
Date: 2006-05-10 17:25:58 UTC
List: ruby-core #7859
On May 10, 2006, at 9:43 AM, Francis Cianfrocca wrote:

> I recently wrote a network-event extension for Ruby ("eventmachine" in
> Rubyforge) and had considerable difficulty working with Ruby  
> threads. Of
> course you can guess the problem: select(2) can't be called by an  
> extension
> if more than one Ruby thread is running.

Why can't you call rb_thread_select?

> I had to use a rather ugly hack to get it to work, since there are  
> no shared synchronization objects between Ruby and native code.
>
> Is it possible to call the Ruby thread scheduler directly from  
> extension
> code? Does that approach even make sense?

Typically this is done by invoking rb_thread_select when you  
encounter a blocking operation on the C side.  This is what I did  
when sendfile(2) returns EAGAIN.

> Does it make sense to enable Ruby's sync primitives to interoperate  
> with
> native ones?

-- 
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

In This Thread