From owner-freebsd-threads@FreeBSD.ORG Wed Apr 13 22:41:53 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAFB316A4CE for ; Wed, 13 Apr 2005 22:41:53 +0000 (GMT) Received: from bute.st-andrews.ac.uk (bute.st-and.ac.uk [138.251.12.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 338DA43D5D for ; Wed, 13 Apr 2005 22:41:52 +0000 (GMT) (envelope-from s_sourceforge@nedprod.com) Received: from kate (res04-ned6.res.st-and.ac.uk [138.251.234.67]) by bute.st-andrews.ac.uk (8.9.1a/8.9.1) with SMTP id XAA06796; Wed, 13 Apr 2005 23:36:51 +0100 (BST) From: "Niall Douglas" To: freebsd-threads@freebsd.org Date: Wed, 13 Apr 2005 23:41:19 +0100 MIME-Version: 1.0 Message-ID: <425DAE1F.5558.EDA8BD7@localhost> Priority: normal In-reply-to: <20050413213038.GA9991@crodrigues.org> References: <425D8546.2050306@he.iki.fi> X-mailer: Pegasus Mail for Windows (4.21c) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Content-Transfer-Encoding: 7BIT Subject: Re: thread aware malloc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2005 22:41:53 -0000 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