SERVER-9580 Fixed problem with sleepmillis() on Windows due to default timer resolution being typically higher than 15ms

All sleepmillis() calls with values lesser than timer resolution will sleep AT LEAST the timer resolution value, making Mongo be really slow on certain use cases. Like when implementing consumer/producer patterns using capped collections to stream objects back and forth
yes


On Tue, Aug 5, 2014 at 3:55 PM, Benety Goh <notifications@github.com> wrote:

> In src/mongo/util/time_support.cpp:
>
> > @@ -669,9 +669,26 @@ namespace {
> >      void sleepsecs(int s) {
> >          Sleep(s*1000);
> >      }
> > +
> > +    extern "C" unsigned int __stdcall timeBeginPeriod( unsigned int ms );
> > +    extern "C" unsigned int __stdcall timeEndPeriod( unsigned int ms );
> > +    // Notice bellow the arbitrary nature of 50ms set as the "minimum" timer resolution
> > +    // There seems to be no complete agreement on that *is* the default timer resolution in Windows.
>
> did you mean "what" instead of "that"
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mongodb/mongo/pull/618/files#r15841097>.
>