Eduard Bloch <[EMAIL PROTECTED]> wrote:
> Package: mpd
> Version: 0.12.1-1.1
> Severity: normal
>
> Hello,
>
> sometimes I see one of mpd processes eating 2..3 percents of my
> amd64-3500+'s CPU time. This is _not_ ok, because this process is
> apparently doing nothing but:
>
> select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)
> select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)
> select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)
> select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)
>
> which looks unsound. If the upstream authors are abusing select in
> favour of usleep/nanosleep or pthread_cond_wait then they should better
> start using the right thing. If not, then there is most likely a bug,
> otherwise I see no point in calling select on 0 file handles. And "busy
> waiting" is bad design anyway.
The busy waiting is a known design issue, but I haven't had time to
redesign the internals of mpd (I started working on it in October, but
got sidetracked with other things).
As far as select versus usleep/nanosleep; select is the most portable
method of sleeping.
--
Eric Wong