From owner-freebsd-threads@FreeBSD.ORG Sun Jun 29 17:22:24 2003 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 59F7C37B401 for ; Sun, 29 Jun 2003 17:22:24 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EA7144014 for ; Sun, 29 Jun 2003 17:22:23 -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.8/8.12.1) with ESMTP id h5U0MMAI002599; Sun, 29 Jun 2003 20:22:22 -0400 (EDT) Date: Sun, 29 Jun 2003 20:22:22 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Petri Helenius In-Reply-To: <005001c33e8f$6d90d6c0$44d5473e@PETEX31> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: rtprio and kse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2003 00:22:24 -0000 On Mon, 30 Jun 2003, Petri Helenius wrote: > > The rtprio() call affects the KSEG in which the thread runs. > > So it is the KSEG that has the realtime priority, and all > > threads that run in that KSEG will be affected. This doesn't > > affect other KSEGs, so if you are creating system scope > > threads (each has their own KSEG and KSE), they will only > > be affected if you call rtprio() from their threads. > > > So if I interpret this correctly, to achieve the "expected" result, What is the expected result? I expect the expected result to be exactly the way that libkse works. If you were to do the same thing in Solaris (pthreads), it would behave just like libkse works: it affects the LWP, not the thread, so any threads running in the LWP would benefit from the priority change. > one should link with -lthr, not -lkse? Expected result being > priorities apply only to threads which call for it. If you want (real-time) priority to apply only to the thread that calls it, then create those threads as scope system threads. > Does -lthr have any (known) issues with spinlocks like linuxthreads has, where > a thread with rtprio going into a spinlock might monopolize the CPU > and the other thread never gets a quantum to actually release the lock? Libpthread(^Wlibkse) has no such problems with mixing KSEs with different kernel priorities. -- Dan Eischen