tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Make condition variables take absolute wakeup time

> Andrew Doran <> wrote:
> > For a sleep ~497 days into the future at 100Hz, yes. Perhaps uint64_t would
> > be better.
> Just a detail, but is not that ~497 days for 1000Hz, and ~4971 days for 100Hz?

497*24*60*60*100 = 0xfff27600

> (YAMAMOTO Takashi) wrote:
> > is it necessary for eg. cv_time_sec to return errors?
> > isn't it enough to simply return the value of hardclock_ticks and
> > let cv_timedwait handle it?
> Separate thing, but while changing this.. Could hardclock_ticks be made
> unsigned? I would say uint32_t. Perhaps same for other *hz counters.

i'm not sure if unsigned is better or not because calculations on
hardclock_ticks almost always need to prepare for wrapping anyway.


> -- 
> Best regards,
> Mindaugas

Home | Main Index | Thread Index | Old Index