This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: malloc() and spinlocks


> I don't care what kind of locking will be there, but webcvs still shows no 
> change, so the slow mutexes are still used.

Jakub has raised a valid point, namely that the single-threaded case
is slowed down, albeit very slightly in my opinion.

I've measured:

_single-thread_ malloc-test.c, it=30000000 size=1030, Duron 900MHz

Without spinlocks:
avg. 36.5sec
With spinlocks:
avg. 36.9sec
-> i.e. about 1% slowdown

I'm trying to get this down further, but I think the patch could also
be applied as-is, since the gain for multiple threads is so
tremendous.  Surprisingly, text size of libc compiled with
malloc-spinlocks went _down_ slightly.

Regards,
Wolfram.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]