From owner-freebsd-threads@FreeBSD.ORG Mon Mar 29 12:41:48 2004 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 5E4E516A4CF for ; Mon, 29 Mar 2004 12:41:48 -0800 (PST) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 578D443D2D for ; Mon, 29 Mar 2004 12:41:47 -0800 (PST) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h81.vuokselantie10.fi [193.64.42.129]) by rms04.rommon.net (8.12.9p1/8.12.9) with ESMTP id i2TKfjcM058011; Mon, 29 Mar 2004 23:41:45 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <40688A09.9070709@he.iki.fi> Date: Mon, 29 Mar 2004 23:41:45 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Niall Douglas References: <4067CC9B.8940.1A12F51@localhost> <40688B80.18775.48ADA9C@localhost> In-Reply-To: <40688B80.18775.48ADA9C@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: freebsd-threads@freebsd.org Subject: Re: GDB 6.0 and FreeBSD threads 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: Mon, 29 Mar 2004 20:41:48 -0000 Niall Douglas wrote: >Here's a thought - surely on a M:N threading implementation the >kernel and user side library can automatically optimise which threads >don't need to be system scope? They could do this by maintaining a > > I would hate to see this happen. The added complexity and unpredictability would make implementations harder because you would have to account for an optimizer which tries to think what´s best for the crappy application/programmer who does not know what he wants. >sleep & i/o history for each thread, noting when which threads run >concurrently, which i/o dependencies exist between threads and from >that dynamically rescope the thread plus perform dynamic priority >boosting to minimise sleeps. Indeed, if the kernel scheduler felt it >was being overtaxed, more threads could be moved in-process. > > > Why not just run all threads SCOPE_PROCESS? Then the system will do that for you. >To me there is little point investing in all the complexity of a M:N >implementation if you don't implement such optimisation features - >otherwise the substantial amounts of extra code cause things to run >slower due to sheer binary size. Of course this subtly breaks POSIX > > The great advantage of process scope threads is the fact that you can hand over a mutex without going trough a process switch. Pete