sleepy receiveTimeout?

Nick Voronin elfy.nv at gmail.com
Sun Dec 19 03:37:51 PST 2010


On Sun, 19 Dec 2010 10:50:08 +0100
Joost 't Hart <Joost.t.Hart at planet.nl> wrote:

> >> Quoting the documentation:
> >>
> >> /Suspends the calling thread for at least the supplied period./
> >>
> >> What does "at least" mean here? Is there also an "at most"? I do not
> >> want my friend to end up in cyberspace. :-)
> >
> > Nope, there isn't :) In ordinary multitasking environment there is no guarantee on upper bound.
> >
> 
> Surely got that bit, but I guess it makes sense to refer a bit more to 
> some good old thread state names: After (exactly!) the given period of 
> "suspension" the thread returns into "ready" state.
> When (if ever) it will become the "running" thread again depends ...

This all nice in theory, but are you sure that every sleep() causes setting of hardware timer? In every OS? In every minor version of OS even? If not (and I'm pretty sure it's not so), then you need to add more details. All about how scheduler works. Or this precise talk on what happen after time is up would just mislead people. Aside from the fact that sometime after time is up thread would become runnable again (which is really obvious, no?) there is nothing to say.

-- 
Nick Voronin <elfy.nv at gmail.com>


More information about the Digitalmars-d-learn mailing list