From: Eric Hodel Date: 2007-03-02T07:20:21+09:00 Subject: Re: replacing the use of gettimeofday in the scheduler On Mar 1, 2007, at 13:30, Tomas Pospisek's Mailing Lists wrote: > On Fri, 2 Mar 2007, Eric Hodel wrote: >> The Ruby thread scheduler uses setitimer(2) and select(2). It >> depends on the wall-clock for implementing features defined in >> terms of the wall-clock (Kernel#sleep and Thread#join). > > You need to add Timeout#timeout to this. Nope. Timeout calls Kernel#sleep in a thread. > But: > > $ ri Kernel#sleep > > Suspends the current thread for _duration_ seconds (which may be > any number, including a +Float+ with fractional seconds). Returns > the actual number of seconds slept (rounded), which may be less > than that asked for if another thread calls +Thread#run+. Zero > arguments causes +sleep+ to sleep forever. > > No reference to wall-clock in there. What do you mean by "defined > in terms of the wall-clock"? When I write "sleep 5" I expect at least five seconds on the clock on my wall to go by before the next statement is executed.