From owner-freebsd-arch@FreeBSD.ORG Fri Mar 28 12:57:15 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A78FD37B401 for ; Fri, 28 Mar 2003 12:57:15 -0800 (PST) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1C3B43FCB for ; Fri, 28 Mar 2003 12:57:14 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc01.attbi.com (sccrmhc01) with ESMTP id <2003032820571300100cu49te>; Fri, 28 Mar 2003 20:57:14 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA71665; Fri, 28 Mar 2003 12:57:12 -0800 (PST) Date: Fri, 28 Mar 2003 12:57:10 -0800 (PST) From: Julian Elischer To: Daniel Eischen In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-25.0 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,RCVD_IN_UNCONFIRMED_DSBL,REPLY_WITH_QUOTES, USER_AGENT_PINE autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) cc: Scott Long cc: arch@freebsd.org Subject: Re: 1:1 threading. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2003 20:57:17 -0000 On Fri, 28 Mar 2003, Daniel Eischen wrote: > On Fri, 28 Mar 2003, Jeff Roberson wrote: > > > On Fri, 28 Mar 2003, Daniel Eischen wrote: > > > > > On Fri, 28 Mar 2003, Daniel C. Sobral wrote: > > > > > > > David Xu wrote: > > > > > > > > > > do you think that a multithreaded process should use more CPU time then > > > > > a single thread process, so threaded process should have higher priority > > > > > and block other single thread processes out? AFAIK, threading is not > > > > > designed for this, you may misunderstand what threading is designed for. > > > > > > > > Threading might not have been originally designed for this, but a lot of > > > > people use it this way, a lot of people *want* it this way, and POSIX > > > > specifically mandates that this way be available. > > > > > > It is available through pthread_attr_setscope(). > > > > > > There's some confusion over this and the way libthr is implemented. > > > KSE's within the same KSE Group were not designed to give more CPU > > > time than a normal unthreaded/single KSE'd process. Unless this > > > has been changed in the kernel somehow, the use of multiple KSEs > > > by libthr or libkse (in a single KSEG) will not get any more CPU > > > time than a non-threaded program. There was some debate over > > > this, but multiple KSEs within a KSEG were _not_ suppose to allow > > > this. You are suppose to create a new KSEG in order to get > > > this behavior. > > > > > > > This is not how it is implemented in either scheduler that we currently > > have. I'm not saying which way is more or less correct because I think > > you could argue either way. We can not entirely correctly implement > > SCOPE_PROCESSES threads right now anyway. > > Well, since we have KSEGs, I'd argue that this is a bug. > Perhaps it was too difficult to do this and no-one thought > you'd ever allow more KSEs in a KSEG than you have CPUs, > so that became the limiting factor. > > > This being said.. It is a property of the thr system calls and not > > libthr. I have a flags field in thr_create() that could be used to > > indicate which scope the thread should contend in. > > BTW, I'm not arguing about libthr implementation here. I'm > just stating what a KSE is (was) suppose to be (which implicitly > describes libthr and libkse behavior). I'm happy to see the limit of (NKSEs !> NCPU) lifted for processes that are in some way identified as 1:1 mode processes.. I don't want to lift it for KSE mode processes however. For system scope threads, I guess you just allocate a separate KSEGRP so it has somewhere to store pertinent info. that makes it rather simple system scope threads have a thread, a KSE and a KSEGRP process scope threads just use the existing KSEGRP. Everythiong should just "fall out correctly" by doing this.. > > -- > Dan Eischen > > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" >