From owner-freebsd-threads@FreeBSD.ORG Mon Jul 3 12:29:22 2006 Return-Path: X-Original-To: threads@freebsd.org 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 AF99216A407; Mon, 3 Jul 2006 12:29:22 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6055643DE5; Mon, 3 Jul 2006 12:29:18 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.6/8.13.6/NETPLEX) with ESMTP id k63CTHnN003380; Mon, 3 Jul 2006 08:29:17 -0400 (EDT) Date: Mon, 3 Jul 2006 08:29:17 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: David Xu In-Reply-To: <200607032020.10993.davidxu@freebsd.org> Message-ID: References: <20060703101554.Q26325@fledge.watson.org> <200607032020.10993.davidxu@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: threads@freebsd.org, Robert Watson , freebsd-threads@freebsd.org Subject: Re: Strawman proposal: making libthr default thread implementation? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jul 2006 12:29:22 -0000 On Mon, 3 Jul 2006, David Xu wrote: > On Monday 03 July 2006 19:48, Daniel Eischen wrote: > >> Yes, you have to support PTHREAD_PRIO_PROTECT, PTHREAD_PRIO_INHERIT >> mutexes, and SCHED_RR, SCHED_FIFO, and SCHED_SPORADIC scheduling >> (hopefully not under the restriction that you are a privileged user). >> > > I would tell you don't implement system scope thread in libpthread, > because system scope thread does not work in the way you said here, > it seems you are telling user that the libpthread is fully working in > the way, but the reality is not, without a correct kernel support, > I don't think you should introduce system scope thread into libpthread, > please remove this feautre if you think libpthread should work in the way. I don't believe that system scope threads have to abide by SCHED_RR, SCHED_FIFO, and SCHED_SPORADIC scheduling since their contention scope is different. > but reality is, mysql is using system scope in libpthread to get better > performance but not process scope thread. in the real world, these > nominal features are also not used widely, using it can only cause > serious performance problem in most applications, until you need hard > realtime, but why do you use FreeBSD if you need hard realtime ? > there are dedicated systems which are designed for this requirement. > I still does not find an application really need this feature. Also > I don't think one can easily implement a modern CPU friendly scheduler > in userland, HTT, shared L2 dual-core, NUMA scheduling, doing it in kernel is > already extreme diffcult, putting lots of effort in single library but other > single threaded application still gain nothing is also not worthy to work > on M:N thread library. This has no impact on libpthread. The KSE is the thing that the kernel knows about and it can keep threads running on the same KSE and assign KSEs to different CPUs, etc. All the threads library has to do is keep threads running on the same KSE. I've said this before, but you keep making the same argument ;-) >> If you can those in libthr, I have no objection. However, these >> are not as easy to do in 1:1. > > it depends on whether one has interest to implement it, nothing > is impossible here, kernel has already turnstile code, this already > made a bit forward. Are you going to do it? -- DE