Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760218AbYHUVEh (ORCPT ); Thu, 21 Aug 2008 17:04:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755295AbYHUVEa (ORCPT ); Thu, 21 Aug 2008 17:04:30 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:46144 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753955AbYHUVE3 (ORCPT ); Thu, 21 Aug 2008 17:04:29 -0400 Date: Thu, 21 Aug 2008 17:04:28 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Michal Hocko cc: Kernel development list Subject: Re: How do I raise the priority of one thread in a multi-threaded process? In-Reply-To: <200808211428.27524.mhocko@suse.cz> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 957 Lines: 24 On Thu, 21 Aug 2008, Michal Hocko wrote: > On Thursday 21 August 2008 12:58:46 pm Alan Stern wrote: > > Can anyone tell me how to raise the priority of one thread in a > > multi-threaded process (using the pthreads library)? Neither nice(2) > > nor setpriority(2) is appropriate since they affect the priority of an > > entire process rather than a single thread. > > Isn't pthread_setschedprio, what you are looking for? Actually I was looking for pthread_setschedparam(). But it wasn't clear at first that I needed to change the policy to SCHED_FIFO and that special capabilities were needed. With those changes it seems to work correctly. Thanks for pointing me in the right direction! Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/