From owner-freebsd-threads@FreeBSD.ORG Wed Jul 9 17:12:20 2003 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 D5E7637B401 for ; Wed, 9 Jul 2003 17:12:20 -0700 (PDT) Received: from pool-151-200-10-97.res.east.verizon.net (pool-141-156-181-146.esr.east.verizon.net [141.156.181.146]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38BE343FAF for ; Wed, 9 Jul 2003 17:12:16 -0700 (PDT) (envelope-from mtm@identd.net) Received: from kokeb.ambesa.net (localhost [IPv6:::1]) id h6A0C80G010909; Wed, 9 Jul 2003 20:12:08 -0400 (EDT) (envelope-from mtm@identd.net) Received: (from mtm@localhost) by kokeb.ambesa.net (8.12.9/8.12.6/Submit) id h6A0C4ok010908; Wed, 9 Jul 2003 20:12:04 -0400 (EDT) (envelope-from mtm@identd.net) Date: Wed, 9 Jul 2003 20:12:04 -0400 From: Mike Makonnen To: Petri Helenius Message-ID: <20030710001204.GB10504@kokeb.ambesa.net> References: <001b01c3463a$0f907a00$0100a8c0@alpha> <006401c3464d$de848a00$812a40c1@PETEX31> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006401c3464d$de848a00$812a40c1@PETEX31> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD/5.1-CURRENT (i386) cc: Kai Mosebach cc: freebsd-threads@freebsd.org Subject: Re: LinuxThreads replacement 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: Thu, 10 Jul 2003 00:12:21 -0000 On Wed, Jul 09, 2003 at 10:11:15PM +0300, Petri Helenius wrote: > >for example, for on database instance, there are about 80 (lthread) > >processes hanging around. > > I would say with 80 threads you?ll get better performance with libkse > since you?ll get less contention on the process scheduler. > It's not as simple as that. In practice a lot of factors about your system and the type of work you're doing will affect the performance. On paper, the SA/KSE method is supposed to combine the best aspects of 1:1 (libthr) and N:1 (libc_r), and should threoretically be "better" than either one. But, in practice, complexity and overhead may drown out the performance gains. Conversely, context switching overhead may not be as great a penalty for the 1:1 model on modern cpus. I don't want to get in a flamewar over this. I just wanted to point out that it's not as simple as "contention on the process scheduler." I think what we need, now that both libthr and libkse are somewhat useable, is some benchmarking comparisons. If you have the time I think we would all be interested to see any performance comparisons you can run with your application. Once you compile the application switching threads libraries is as simple as editing /etc/libmap.conf. Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | D228 1A6F C64E 120A A1C9 A3AA DAE1 E2AF DBCC 68B9 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon!