An application (running on linux 2.6.31) is paced using usleep
calls. However, it looks like it is not resilient to a date change (either using date
from a shell or using clock_settime
from another process).
What is the right thing to do to avoid the application to be locked ?
edit1
Say the application wants to do something every 100ms. When the job is done, it calls gettimeofday, and deduce the remaining ms to sleep until the next 100ms slice, then it calls usleep.