thread aware malloc
Niall Douglas
s_sourceforge at nedprod.com
Wed Apr 13 15:41:53 PDT 2005
On 13 Apr 2005 at 17:30, Craig Rodrigues wrote:
> On Wed, Apr 13, 2005 at 11:47:02PM +0300, Petri Helenius wrote:
> >
> > Is somebody already working on thread-optimizing malloc to have less
> > contention, avoid false sharing issues, etc.?
>
> Niall Douglas mentioned that FreeBSD might want to look at ptmalloc2
> which is used in Linux:
>
> http://lists.freebsd.org/pipermail/freebsd-threads/2005-February/00284
> 8.html
>
> but I don't know if anyone is actively looking at this for FreeBSD.
I've already ported ptmalloc2 to FreeBSD. The performance increase is
steller to put it mildly, even with FreeBSD's poor multithreading
performance. You're talking ten or more times faster in heavily
multithreaded code :)
http://www.nedprod.com/programs/Win32/ptmalloc2/index.html
All it requires is someone to merge it with FreeBSD's libc. The
licence is LGPL but the original ptmalloc2 is BSD-like. You almost
certainly could replicate the glibc changes and thus maintain the BSD
license in very little time.
Cheers,
Niall
More information about the freebsd-threads
mailing list