From owner-freebsd-threads@FreeBSD.ORG Tue Dec 5 17:32:19 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA8D416A416 for ; Tue, 5 Dec 2006 17:32:19 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outL.internet-mail-service.net (outL.internet-mail-service.net [216.240.47.235]) by mx1.FreeBSD.org (Postfix) with ESMTP id F13C043CA6 for ; Tue, 5 Dec 2006 17:31:37 +0000 (GMT) (envelope-from julian@elischer.org) Received: from shell.idiom.com (HELO idiom.com) (216.240.47.20) by out.internet-mail-service.net (qpsmtpd/0.32) with ESMTP; Tue, 05 Dec 2006 09:15:52 -0800 Received: from [192.168.2.4] (home.elischer.org [216.240.48.38]) by idiom.com (8.12.11/8.12.11) with ESMTP id kB5HTiWg053830; Tue, 5 Dec 2006 09:29:45 -0800 (PST) (envelope-from julian@elischer.org) Message-ID: <4575AC88.3010208@elischer.org> Date: Tue, 05 Dec 2006 09:29:44 -0800 From: Julian Elischer User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: Joshua M References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-threads@freebsd.org Subject: Re: Threading arch quetions X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2006 17:32:20 -0000 Joshua M wrote: >> From: Julian Elischer >> To: Joshua M >> CC: freebsd-threads@freebsd.org >> Subject: Re: Threading arch quetions >> Date: Mon, 04 Dec 2006 13:57:17 -0800 > >> We adopted a scheme which would allow us to implement both M:N threads >> and 1:1 threads with compatible libraries that do it each way. >> The hope was that this would allow people to experiment with these. >> and for us to be able to select the best approach. > > Thank you for your response. > Can you please name those libs ? /usr/lib/libpthread.so (also known in the past as libkse.so) M:N library (though it can be configured to run 1:1) /usr/lib/libthr.so 1:1 library > >> There are examples where M:N outperforms 1:1 but they are the >> minority, so we will be switching the default library to >> 1:1 threads > > What is the default library ? libpthread.so (for now) > >> >> Note that the kernel support for threads is the same for both models, >> where processes have sub-entities (kernel schedulable entities) called >> threads, as opposed to in Linux where each thread is a separate process. > > This is the point i dont understand at all. As i understood KSE is an N > to M approach and it is implemented in FBSD. So how 1:1 is supposed to > coexist if finally everythig is converted to N to M ? does it mean that > basically FBSD if it wants 1 to 1 always creates 1 KSEG per thread and > thus create a *simulation* of 1 to 1 approach ? in M:N threading, you only create a small number of kernel threads. Whenever a user thread goes into the kernel and BLOCKS there, you create a new kernel thread and allow it to go back to userland in place of teh one that blocked, to give the userland threads a chance to keep running. in 1:1 threading you create more kernel threads.. one for each user thread, so when one blocks, no extra work is needed.. the other user threads already HAVE the capacity to keep running. nothing is simulated.. > > Thank you again. > > _________________________________________________________________ > Windows Live Spaces : créez votre Space à votre image ! > http://www.windowslivespaces.fr/