From: Gary Wright Date: 2007-11-07T05:23:46+09:00 Subject: Re: Changing date backward messes up threaded sleep On Nov 6, 2007, at 9:44 AM, Robert Williams wrote: > Bump...I also need this resolved. > > This also occurs with select having a timeout...which I believe is > ruby's definition of sleep anyway. > What do you mean by 'also'? Your first posting was about a timeout with select. Ruby's sleep actually is a request to the thread scheduler to stop the current thread until the system clock has reached (now + delay). So if you move the clock backwards, it will take that much longer to reach (now + delay). If you move the clock forwards then the thread becomes runnable immediately. This might also explain why your C version works since it is probably calling the sleep/nanosleep system call rather than communicating with some process based/green thread scheduler. Gary Wright