Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <008901c0fe33$d5f75fc0$0200a8c0@lifelesswks> From: "Robert Collins" To: "Brian Genisio" Cc: References: <200106251631 DOT f5PGV0H19106 AT pilot14 DOT cl DOT msu DOT edu> <4 DOT 3 DOT 1 DOT 0 DOT 20010626072021 DOT 0190eef0 AT pilot DOT msu DOT edu> Subject: Re: setting thread prioirty Date: Tue, 26 Jun 2001 21:33:34 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-OriginalArrivalTime: 26 Jun 2001 11:21:51.0131 (UTC) FILETIME=[3240EEB0:01C0FE32] ----- 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 me. > >The two > > > threads compete for processor, slowing down the entire system. > > > >This should work :}. All my testcases seemed to run ok. Can you provide > >a testcase showing the problem?. > >If your problem is simple contention - that the pri 0 thread gets less > >cpu than the -20 thread, then that is expected. If there are locking and > >reosurce issues occuring I need a test case to demonstrate the problem, > >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 not > 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, but > keep the spawned thread to the normal priority. The above did not work, > 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. Rob -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/