Since the call to pthread_cond_timedwait() always happens at the same point in the cycle - wouldn't it be more adequate to actually measure the time since the last round and run a simple control loop on it? So that it would compensate for additional overhead and adjust to things without having to measure the overhead?
Since the call to pthread_ cond_timedwait( ) always happens at the same point in the cycle - wouldn't it be more adequate to actually measure the time since the last round and run a simple control loop on it? So that it would compensate for additional overhead and adjust to things without having to measure the overhead?