On Wed, 2014-03-26 at 11:34 -0400, Nitin Shah wrote: > We have been looking at the code and wondered if CLOCK_MONOTONIC can be used. > Qpid uses AbsTime everywhere. > Now it is possible that Qpid has decided to use REALTIME because there is the > need for a real time clock between machines running Qpid; there might be > timers in the client & the daemon that depend on using the same time > reference. > > Any thoughts?
If you want to try a local patch using CLOCK_MONOTONIC would be a good approach. However note that there are at least a couple of issues with just changing the AbsTime implementation. The Timer code uses pthread_cond_timedwait() for scheduling. This assumes that it is given times from CLOCK_REALTIME by default. So you will also need to change the way that Condition is constructed to use CLOCK_MONOTONIC instead. (use pthread_condattr_init(), pthread_condattr_setclock() to create an condattr struct and then attach it to the condvar when making it with pthread_cond_init(). There are places where we use Abstime to construct a date/time - this is not directly possible with CLOCK_MONOTONIC as the EPOCH would now be the machine boot not 1/1/1970. But give this a try and let us know - create a Jira, attaching patches, that will give us a way to commit your changes. Andrew --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
