R
Robert Williams
I am using ruby 1.8.6 on Fedora Core 6 and 7
I have encountered a problem with the timeout for a select statement
inside a thread or fork.
If the timeout is set for a duration of time and the system time is
moved back one hour the duration is increased 1
hour. If the time is moved forward 1 hour the duration is shortened one
hour or fires instantly once the duration has
been exceeded.
I tested this functionality in c and timeout duration is not impacted by
a system time change.
For a simple test...
create a thread that loops 30 times
sleep for 1 second (select with 1 second timeout)
and put a string to the console
While the program is running set the system time back say 5 seconds
you will see a 5 second gap between prints.
I have encountered a problem with the timeout for a select statement
inside a thread or fork.
If the timeout is set for a duration of time and the system time is
moved back one hour the duration is increased 1
hour. If the time is moved forward 1 hour the duration is shortened one
hour or fires instantly once the duration has
been exceeded.
I tested this functionality in c and timeout duration is not impacted by
a system time change.
For a simple test...
create a thread that loops 30 times
sleep for 1 second (select with 1 second timeout)
and put a string to the console
While the program is running set the system time back say 5 seconds
you will see a 5 second gap between prints.