Active waiting?

Alvaro G. M. alvaro.gamez at hazent.com
Thu Apr 2 19:11:16 BST 2015


Hi, Nicolas

On Wed Mar 25 21:40:14 2015 Nicolas Sebrecht <nicolas.s-dev at laposte.net> wrote:
> On Mon, Mar 23, 2015 at 09:49:58PM +0100, Nicolas Sebrecht wrote:
> 
> > To get quicker react on events, you could try something like that:
> > 
> > nloop = timeout / 30
> > while nloop > 0:
> > if event.isSet():
> > break
> > time.sleep(30)
> > nloop -= 1
> > 
> > which enables to react each 30 seconds at most for events.
> 
> Did you test the above snippet by any chance? I consider including it in
> the mainline.

I've been testing this patch for the pas few days while on vacation and I've not noticed any battery improvement, and powertop shows basically the same number of wakeup events.

I don't know if time.sleep does the same kind of busy waiting, I believe not, but then I don't know what's causing these wakeups.





More information about the OfflineIMAP-project mailing list