From owner-freebsd-threads@FreeBSD.ORG Thu Jan 15 03:43:17 2009 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE03A106567E for ; Thu, 15 Jan 2009 03:43:17 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 8EE878FC0C for ; Thu, 15 Jan 2009 03:43:17 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n0F3Pfww018556; Wed, 14 Jan 2009 22:25:41 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.0 (mail.netplex.net [204.213.176.10]); Wed, 14 Jan 2009 22:25:41 -0500 (EST) Date: Wed, 14 Jan 2009 22:25:41 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Pramod Srinivasan In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-threads@freebsd.org Subject: Re: Priority scheduling in 6.x 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: Thu, 15 Jan 2009 03:43:18 -0000 On Wed, 14 Jan 2009, Pramod Srinivasan wrote: > Hi, > > I have 3 threads low, medium and high , and the scheduling policy is set to > SCHED_FIFO. The priority of the threads are at 28,29,30 respectively. Looks > like on FreeBSD 6.x, the priority of the threads are not honored while > scheduling the threads, but the same test on FreeBSD 7.x seems to work fine. > Are there known issues with the priority scheduling in FreeBSD 6.x or am I > doing something wrong? (I am using libthr) Are you using libpthread or libthr on 6.3? If you are using libthr, then you need to be running with superuser privileges for SCHED_FIFO to work. I'm not sure if this works correctly at all in 6.3. If you are using libpthread, then it will work if the threads are PTHREAD_SCOPE_PROCESS, but will not work if they are PTHREAD_SCOPE_SYSTEM. You do not need superuser privileges for SCHED_FIFO with libpthread and process scope threads. I don't believe the kernel has ever worked properly for libpthread (kse) SCHED_FIFO system scope threads. -- DE