From: Jano Svitok Date: 2007-11-03T19:54:37+09:00 Subject: Re: Fine grained management of timers. On 11/3/07, snacktime wrote: > We have a rails app that does async requests to backend data stores. > We send up to 10 of these requests for every http request, and 2-3 ms > matters. I do have one thread that I spin up inside rails that wraps > a select() loop, and another loop that gets entered when a controller > is waiting for a response. In that second loop I use a call to > sleep(). Sleep seems really unpredictable, probably because of it's > interaction with the thread timers via ruby's scheduler. I've though > about using nanosleep via inline C, but even if that worked it would > probably block the thread causing worse problems. > > > So is this something that I just have to live with, or is there any > other way to get the equivalent of usleep/nanosleep? > > Chris http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/249226