From owner-freebsd-threads@FreeBSD.ORG Fri Apr 30 14:04:04 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 932DD16A4CE for ; Fri, 30 Apr 2004 14:04:04 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3877043D58 for ; Fri, 30 Apr 2004 14:04:04 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i3UL42S8029132; Fri, 30 Apr 2004 17:04:03 -0400 (EDT) Date: Fri, 30 Apr 2004 17:04:02 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Petri Helenius In-Reply-To: <40927537.6070405@he.iki.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: freebsd-threads@freebsd.org Subject: Re: system priorities 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: Fri, 30 Apr 2004 21:04:04 -0000 On Fri, 30 Apr 2004, Petri Helenius wrote: >=20 > Am I correct in the observation that threads inherit their scheduling=20 > priority (nice and rtprio) > from the first "main" thread in the process instead of the parent thread? As it stands now, newly created KSEGs inherit from the creating KSEG. The nice and rtprio priorites are stored in the KSEG. > I=B4m creating a few system scope threads from a rtprio main process and= =20 > then dropping rtprio in the created threads and then creating more=20 > threads from them which seem to get rtprio from somewhere. It looks like rtprio will set the priority of the first KSEG in the proc's list of KSEGs. This isn't necessarily the first KSEG created (main). In fact, newly created KSEGs get inserted onto the head of the list, so rtprio() may act on different KSEGs depending on if it is called before or after any KSEG creations. [ System scope threads =3D=3D new KSEG creation ] > Is there a specification reference on this and if not, would it make=20 > more sense to inherit them from the parent thread? I think they do inherit from the parent KSEG, but rtprio() may not be setting the priority for the current KSEG. I would really like a Solaris-like priocntl() so that you can specify which KSEG (or whatever thing that will hold the priority in the future) to act on. --=20 Dan Eischen