From owner-freebsd-threads@FreeBSD.ORG Mon Jul 3 12:20:34 2006 Return-Path: X-Original-To: threads@freebsd.org Delivered-To: freebsd-threads@FreeBSD.ORG Received: from localhost.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id E860016A49E; Mon, 3 Jul 2006 12:20:33 +0000 (UTC) (envelope-from davidxu@freebsd.org) From: David Xu To: freebsd-threads@freebsd.org, Daniel Eischen Date: Mon, 3 Jul 2006 20:20:10 +0800 User-Agent: KMail/1.8.2 References: <20060703101554.Q26325@fledge.watson.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607032020.10993.davidxu@freebsd.org> Cc: threads@freebsd.org, Robert Watson Subject: Re: Strawman proposal: making libthr default thread implementation? 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: Mon, 03 Jul 2006 12:20:34 -0000 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. 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. > 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. David Xu