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
I added the comments to Mongo engineers have more context... not meant to
stay in the code.
I decided to add them after it became apparent that folks from Mongo where
going to take the code, and merge it manually.


On Tue, Aug 5, 2014 at 3:56 PM, Benety Goh <notifications@github.com> wrote:

> In src/mongo/util/time_support.cpp:
>
> >      void sleepmillis(long long s) {
> >          fassert(16228, s <= 0xffffffff );
> > +        // When our waiting period falls bellow Windows min resolution, let's set resolution
> > +        // to 1 ms. Note that this change may effect all kernel scheduler thread operations.
> > +        // Apparently this changes the Windows kernel "quantum" length
> > +        // see http://msdn.microsoft.com/en-us/library/windows/desktop/dd757624(v=vs.85).aspx
>
>
> > +        // Applications such as Google Chrome seem to do this during the life of Chrome, that's why
>
> "Application... Chrome... that's why"
> I wouldn't bother with this comment in the code.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mongodb/mongo/pull/618/files#r15841187>.
>