From: Gary Wright Date: 2007-03-06T01:32:39+09:00 Subject: Re: replacing the use of gettimeofday in the scheduler On Mar 5, 2007, at 9:03 AM, Tomas Pospisek wrote: > With the current "broken" semantics, that would work just right, > since with > the current implementation sleep() time would increase/decrease in > parallel > with the "sysadmin" changing the system time with "date -s" or > similar. Any serious sysadmin will use a NTP based configuration to manage the time on their system. Time adjustments will slow or speed up the clock but won't cause it to skip ahead or back. Your proposal seems like a lot of effort to go through and it certainly won't prevent a sysadmin from just issuing "kill -9 pid". My point is that you'll never be able to write a program that successfully operates in the presence of a malicious or ignorant superuser. As a compromise, maybe a scheme could be devised to *detect* when the clock has been readjusted and to cause an exception. I'm not sure if that would be helpful or useful, but it is probably easier than trying to craft a portable user-space scheduler that is independent of the system clock (especially without vendor support via POSIX or other industry standard). Gary Wright