[ELDK] Problem with pthread_cond_wait on 8xx?

Detlev Zundel dzu at denx.de
Wed Sep 23 14:13:21 CEST 2009


Hi Frank,

> I have a problem with high CPU load on 8xx when using pthread_cond_wait.
> I'm using the glibc v2.6 that came with ELDK 4.2, compiled with NPTL
> support. The same code compiled for x86 works fine (but then using
> glibc 2.9). I'm running torvalds mainline kernel v2.6.26-rc2.
>
> Can anyone here using ELDK 4.2 on 8xx or another PowerPC target try to
> compile the program listed below and check the CPU load when running
> it? Or pinpoint a problem with the code.
>
> My current assumption is that the glibc pthread_cond_wait call is
> implemented using
> busywaiting/spinlocking on 8xx, or something is wrong in the kernel.

Actually I can reproduce both of your behaviours on my x86 and on a
PowerPC system ;)

I don't understand why this is the case, but if I compile the program
without "-lpthread" I have ~100% CPU utilization on both systems.  If I
do "the right thing" and compile with "-lpthread" everything is fine on
both systems.

Maybe someone here on this list can explain this?

Cheers
  Detlev

-- 
There is no need to be  rigid in carrying out policies about what changes
to install.  To do a good job of maintaining Emacs doesn't require acting
like government bureaucrats.
                -- Richard Stallman <E1MIx3Y-0005iZ-OH at fencepost.gnu.org>
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the eldk mailing list