From owner-freebsd-threads@FreeBSD.ORG Thu Jul 10 03:22:25 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 AA25E37B401 for ; Thu, 10 Jul 2003 03:22:25 -0700 (PDT) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A70943F85 for ; Thu, 10 Jul 2003 03:22:25 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfjrs.dialup.mindspring.com ([165.247.207.124] helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19aYZ9-0003fi-00; Thu, 10 Jul 2003 03:22:20 -0700 Message-ID: <3F0D3E1D.F26FA9E1@mindspring.com> Date: Thu, 10 Jul 2003 03:21:17 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Mike Makonnen References: <001b01c3463a$0f907a00$0100a8c0@alpha> <20030710001204.GB10504@kokeb.ambesa.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a43df10a0ee0c97f68809d6e40539e6099387f7b89c61deb1d350badd9bab72f9c350badd9bab72f9c 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 10:22:26 -0000 Mike Makonnen wrote: > 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. The most intersting issue is that the pthread_setconcurrency() controls how many blocking contexts (KSEGs) you have available. If process space is at a premium, you can scale to a much larger number with KSE than you would be able to with Linux threads, since with KSE, the threads are really rather light-weight user space things. You made a statement before that you had 80 threads, and with Linux threads, you were feeling it at 80. I wasn't sure from the context whether you meant 80 was to many for your system or 80 was too few for your application, so I didn't say anything before. But this could definitely be a big factor in your choice of threading library, given your previous statement. -- Terry