Re: using select as a sleep call



novickivan@xxxxxxxxx <novickivan@xxxxxxxxx> wrote:
I was wondering if it is valid to use select as a sleep call.

"Back in the day" when the only choices were select() and sleep(),
given sleep() only slept for an integer number of seconds, those who
wanted a short sleep would use select(). And back then one often only
got 10 millisecond resolution - and liked it!-)

With the advent of usleep() and nanosleep() however many years ago
using select() for short sleeps has fallen out of favor.

rick jones
--
Process shall set you free from the need for rational thought.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
.



Relevant Pages

  • Re: msleep() on recursivly locked mutexes
    ... mtx_drop_recurse(struct mtx *mtx) ... Further the idea that holding a mutex "except for when we sleep" is a generally bright idea is also a bit odd to me.. ... while you slept. ... It seems to me that if someone else held that lock for some purpose when you slept, ...
    (freebsd-hackers)
  • Re: Sleep Dr appt
    ... it IS a true test of love! ... He spent a full hour with me discussing my history and sleep issues. ... to have a sleep study, ... slept in years and I slept through the night both nights. ...
    (alt.support.chronic-pain)
  • Re: How to stop the night wakings?
    ... My mom advised me never to have the children sleep in the room with me ... Maybe as a result of that, mine slept through the night relatively ... co-sleeping was a life saver the first year. ... b'fast, snack and lunch, and the babysitter feeds her whatever the ...
    (misc.kids)
  • Re: How to stop the night wakings?
    ... My mom advised me never to have the children sleep in the room with me ... Maybe as a result of that, mine slept through the night relatively ... How about switching the beds? ... straight to bed before you and your dh eat. ...
    (misc.kids)