From owner-freebsd-current@FreeBSD.ORG Thu May 29 05:12:42 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FA8A79C for ; Thu, 29 May 2014 05:12:42 +0000 (UTC) Received: from COL004-OMC2S5.hotmail.com (col004-omc2s5.hotmail.com [65.55.34.79]) by mx1.freebsd.org (Postfix) with ESMTP id EE9762C42 for ; Thu, 29 May 2014 05:12:41 +0000 (UTC) Received: from COL131-DS4 ([65.55.34.71]) by COL004-OMC2S5.hotmail.com with Microsoft SMTPSVC(7.5.7601.22678); Wed, 28 May 2014 22:12:35 -0700 X-TMN: [I7yLW7hl5r5k7qjgHoO04HUivOYhl0Ld] X-Originating-Email: [fredhps10@hotmail.com] Message-ID: From: Fred Pedrisa To: "'freebsd-current'" Subject: Thread Scheduler Priority Date: Thu, 29 May 2014 02:12:59 -0300 MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: Ac96/Fg2VW7HJ/dURHiCydrhzgYRWg== Content-Language: pt-br X-OriginalArrivalTime: 29 May 2014 05:12:35.0081 (UTC) FILETIME=[99FBFF90:01CF7AFC] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 05:12:42 -0000 Hi, Guys. How can I adjust a certain thread to have the maximum system priority in the scheduler ? I've tried doing it this way : /* Set thread priority. */ if (pthread_getschedparam(ts[gnThreadID], &police, ¶m[gnThreadID]) != 0) { error ("Unable to get priority"); return 1; } param[gnThreadID].sched_priority = 99; if (pthread_setschedparam(ts[gnThreadID], police, ¶m[gnThreadID]) != 0) { error("Unable to set priority"); return 1; } However, in 'top', I don't see the process threads switching to -92 priority, like other threads in the system, is something I did wrong or maybe I might be missing something ?