[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Networking: select() blocks for seconds (> timeout)
From:       Joel VanderWerf <joelvanderwerf () gmail ! com>
Date:       2010-06-30 21:03:02
Message-ID: 4C2BB101.7030107 () gmail ! com
[Download RAW message or body]

Roger Pack wrote:
>>> Try your code with
>>> BasicSocket.do_not_reverse_lookup=true
>> Three observations:
>>
>> a) I do not think that there can be a DNS lookup between a 'select(x, y, 
>> z)' and a 'socket.recvfrom'.
> 
> It might, see 
> http://www.ensta.fr/~diam/ruby/online/ruby-doc-stdlib/libdoc/socket/rdoc/classes/Socket.html#M001258
> 
> Why don't you try it and find out?

Seconded: it's worth a try.

Also, if you really believe this is GC-related, you can prove it by 
GC.disable before the select, GC.enable after the recvfrom.

It seems highly unlikely that GC would be eating up 10 seconds.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic