Boost logo

Boost :

Subject: Re: [boost] [Boost.Interprocess] conditions variables get 10 times faster when opening a multiprocess browser
From: Peter Dimov (lists_at_[hidden])
Date: 2013-08-21 11:43:20


Gav Wood wrote:
> The default 'blind' prior is a simple exponential expectation whereby
> we assume for any given duration of waiting 't', that the expected
> completion time is 2t; i.e. we expect to wait as long as we have
> already been waiting. As such, the optimum time to start with the
> 'sleep(1)' strategy (which from my tests sleeps for a full 20ms
> timeslice) is after 20ms, (only after which point the prior leads us
> to assert that the completion will probably take at least another
> 20ms).

For a 20ms timeslice, this means that one should Sleep(1) after 10ms of
Sleep(0).

But the timeslice is not necessarily 20ms. A call to timeBeginPeriod(1) may
shorten it.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk