My problem is related to the behaviour of sleep function. If, during the execution of sleep function, I change the system clock of my PC, sleep function will not recover from sleeping when it should. Example: My controller: def index logger.info "Start sleeping at:"+Time.now.to_s sleep 5 logger.info "Sleeping finished at:"+Time.now.to_s end Everythink works well if I don''t change the system time during the execution of sleep function. However, if during the execution of sleep function I shift the system time, let''s say 1 minute back, I''ll need to wait 1 minute and 5 seconds until the sleep function finishes. I''d need to force sleep function to sleep always 5 seconds, even if the system time changes during the call of the sleep function. If I try somethink similar in pure ruby (no rails), everythink works as expected, I can change system time without any consequences to the behaviour of sleep function. I am using Rails 1.2.1 under WinXP. Thanks for your help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Alex Wayne
2007-Feb-12 20:10 UTC
Re: sleep function duration changes when system clock is mod
Jan wrote:> My problem is related to the behaviour of sleep function. If, during > the execution of sleep function, I change the system clock of my PC, > sleep function will not recover from sleeping when it should.While odd, why is this really a problem? You shouldnt be manually changing the system clock very often. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The server application will be running on customer''s PC and the sleep function is used in a background thread. In these conditions, the manual change of system clock may happen and I would''nt like if this freezed the background thread.> While odd, why is this really a problem? You shouldnt be manually > changing the system clock very often.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Robert Williams
2007-Nov-06 14:46 UTC
Re: sleep function duration changes when system clock is mod
Bump...I am also experiencing this problem with Fedora Core 6 & 7 http://www.ruby-forum.com/topic/123178#new http://www.ruby-forum.com/topic/130593#new -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---