From: Tomas Pospisek Date: 2007-03-01T23:45:25+09:00 Subject: replacing the use of gettimeofday in the scheduler using gettimeofday in the scheduler is problematic, since it's possible that the system time will jump ahead or back because of the user or ntp resetting the time [1]. This can have side effects such as sleep() and timeout() never returning and thus threads not ever being scheduled again and seems to have also other side effects [3]. Eric Hodel is arguing [2] that replacing the existing mechanism that uses libc-select to sleep and getimeofday to calculate the effectively elapsed time by libc-sleep is also problematic because: "[for libc-sleep]... system activity may lengthen the sleep by an indeterminate amount." However, this applies in exactly the same way to libc-select as well and thus replacing the select/gettimeofday mechanism by libc-sleep should at least work no worse. Objections? Has there been any effort to implement a solution based on sleep/usleep? Is the interest to implement a more robust schedule timing mechanism? Is there a chance for a patch based on sleep/usleep to make it into CVS? *t [1] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/103140 [2] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/103245 [3] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/229829 ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.