[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Lots of CPU usage with MHD_USE_POLL
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] Lots of CPU usage with MHD_USE_POLL |
Date: |
Tue, 9 Feb 2010 09:10:01 +0100 |
User-agent: |
KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; ) |
Hi Boyan,
I don't know what version of MHD you are talking about, but in both SVN HEAD
and MHD 0.4.5 (the only released version with support for poll), the third
argument given to 'poll' is already "1000".
Best,
Christian
On Monday 08 February 2010 09:31:15 Boyan Kasarov wrote:
> Hello,
>
> I noticed that in function:
>
> static int
> MHD_poll (struct MHD_Daemon *daemon)
> {
> ...
> if (poll(&p, 1, 0) < 0) {
> ...
> }
>
> The timeout for poll() call is 0 milliseconds, so the call does not
> block at all, which causes lots of CPU usage.
>
> As a workaround I changed the timeout from 0 to 1000 (1 second) and it
> works fine for me.
>