This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Pthread Priorities
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 29 Sep 2008 18:45:08 +0200
- Subject: Re: Pthread Priorities
- References: <a201f7f00808311516m251b7928vcbad9f722188755f@mail.gmail.com>
- Reply-to: cygwin at cygwin dot 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/