xfce4-mailwatch-plugin pegging the CPU usage meter.
Brian J. Tarricone
bjt23 at cornell.edu
Sat Oct 18 19:27:03 CEST 2008
Please file a bug on bugzilla with your patch. Otherwise I'll lose
track of it.
On Sat, 18 Oct 2008 10:26:23 -0500 Grant Edwards wrote:
> On 2008-10-17, Grant Edwards <grante at visi.com> wrote:
>
> > Right. But, a select that blocks for a second, checks a
> > timeout, then blocks for another second will use a negligible
> > amount of CPU. So that's not actually what's going on. I
> > suspect that when the select() wakes up, the subsequent loop
> > that's calling gnutls_*_recv() is spinning without ever
> > returning to the top of the outer loop where the select()
> > happens. When I have an hour or two to spare, I'm going to
> > take a look at it...
>
> Yup. That was the problem. They busy-wait loops in
> xfce_mailwatch_net_conn_recv_internal() that spin calling
> recv() and gnutls_record_recv() were burning up a lot of CPU
> time. The attached patch drastically reduces CPU usage by
> sleeping for 50ms each time through the busy-wait loop.
>
More information about the Xfce
mailing list