This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pthread Priorities


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]