setting thread prioirty

Robert Collins
Tue Jun 26 04:31:00 GMT 2001

----- Original Message -----
From: "Brian Genisio" <>
To: "Robert Collins" <>
Sent: Wednesday, June 27, 2001 12:26 AM
Subject: Re: setting thread prioirty

> >
> > > I have tried setting the attribute to priority 0 with the
> > > pthread_attr_setschedparam.  Unfortunately, this does not work for
> >The two
> > > threads compete for processor, slowing down the entire system.
> >
> >This should work :}. All my testcases seemed to run ok. Can you
> >a testcase showing the problem?.
> >If your problem is simple contention - that the pri 0 thread gets
> >cpu than the -20 thread, then that is expected. If there are locking
> >reosurce issues occuring I need a test case to demonstrate the
> >and then I'll look into it.
> It is quite difficult to show a test case... Very large, internal
> application... And synchronization is not an issue, because they do
> require it... but what I find, is that if both threads are at high
> priority,  they work so hard, that the rest of the system bogs down.
So I
> wanted my most important thread, the parent to have a higher priority,
> keep the spawned thread to the normal priority.    The above did not
> but the following did the trick for me... :
> SetThreadPriority( GetCurrentThread(), THREAD_PRIORITY_HIGHEST);

Which is essentially what we call when the thread priority is set to
sched_get_priority_max(). So there must be a bug of some sort. If I get
the time (ha!) to create a test case I'll look into this. However,
testcases _really_ make it simpler to track down - you know the
circumstances your app is running under, and I don't, so recreating your
bug symptoms is much harder for me than it is for you.

I've cc'd this back to the list for posterity.


Unsubscribe info:
Bug reporting:

More information about the Cygwin mailing list