malloc() and spinlocks

Wolfram Gloger Wolfram.Gloger@dent.med.uni-muenchen.de
Tue Nov 26 06:24:00 GMT 2002


> Isn't it better to have the fast inline non-recursive mutices provided
> for _LIBC only use by the threading library (this could be something like
> lll_mutex_lock for nptl and something similar for linuxthreads)?

I agree it would be better to have this in a more general form.  If
you (or anyone) provide(s) a patch with lll_mutex_lock... etc. macros,
I'll gladly adapt thread-m.h.

> The spinlocks below inline quite a lot of code, ideally it should be just
> lock; xaddl; testl; jne lab_in_other_subsection

I believe only mutex_lock is non-optimal and inlines a sizeable piece
of code.  But it would be good to have this for non-i386 architectures
too.

Regards,
Wolfram.



More information about the Libc-alpha mailing list