X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Mon, 29 Sep 2008 18:45:08 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Pthread Priorities
Message-ID: <20080929164508.GA11053@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <a201f7f00808311516m251b7928vcbad9f722188755f@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <a201f7f00808311516m251b7928vcbad9f722188755f@mail.gmail.com>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Aug 31 23:16, Paul Carter wrote:
> Hi,
> 
> Does anyone know if setting explicit priorities is currently working
> under cygwin/pthread?
> 
> I am calling the following:
> * pthread_attr_setschedparam() with a fixed priority between -14 and 5
> * pthread_attr_setschedpolicy with SCHED_FIFO parameter
> * pthread_attr_setinheritsched with PTHREAD_EXPLICIT_SCHED parameter
> 
> >From within the spawned thread I am calling pthread_getschedparam()
> but this always returns current priority 0. This is confirmed by the
> fact that two threads which are running at different priorities just
> seem to timeslice between each other.
> 
> Is this expected behavour?

I'm not overly fluent with pthreads but the code to handle this stuff is
in Cygwin.  But for some reason the code to handle
PTHREAD_EXPLICIT_SCHED, setting the scheduler settings for the newly
created thread, is commented out in conjunction with a FIXME comment.
Unfortunately the comment does not explain why this has been done.
Does it work better to call pthread_setschedparam explicitely in the
spawned thread?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

