delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/06/25/20:26:52

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <037901c0fdd2$e8d6bac0$0200a8c0@lifelesswks>
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: <cygwin AT sources DOT redhat DOT com>,
"Brian Michael Genisio" <genisiob AT pilot DOT msu DOT edu>
References: <200106251631 DOT f5PGV0H19106 AT pilot14 DOT cl DOT msu DOT edu>
Subject: Re: setting thread prioirty
Date: Tue, 26 Jun 2001 09:59:44 +1000
MIME-Version: 1.0
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: 25 Jun 2001 23:48:03.0543 (UTC) FILETIME=[46471670:01C0FDD1]

----- Original Message -----
From: "Brian Michael Genisio" <genisiob AT pilot DOT msu DOT edu>
To: <cygwin AT sources DOT redhat DOT com>
Sent: Tuesday, June 26, 2001 2:31 AM
Subject: setting thread prioirty


> Hello,
> I was wondering if it is possible in cygwin for a thread to have a
different
> priority than it's parent.  That is, If I call a program with nice,
such as :
> nice -n -20 <command>
> And the program spawns a thread... I want the thread to run at Normal
priortiy,
> and the main thread to remain at high prioirity.
>
> 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.

> Before I was using threads, I had the two threads as separate
programs, and I
> could set each program to the level I chose... but IPC communication
was slow,
> or didnt work well enough for me.  So, I put them in the same thread,
and now
> they act as if I put the separate programs in high priority.
>
> Any Ideas?

If you haven't designed your cross-thread API carefully you may simply
be blocking each thread very often waiting on the other thread. On the
other hand there may be a bug *shrug*.
First thing for you to do: get the most recent developer snapshot
(currently that is 2001-jun-22) as there are lots of bugs fixed w.r.t.
threading. Revalidate your problem on that dll. Then start looking for a
testcase/at your syncronisation methods.

Rob

> Thanks,
> Brian
>
>
>
>
> --
> ---------------------------
>       \\|//   Brian Genisio
>       (o o)        genisiob AT pilot DOT msu DOT edu
> ~~oOOo~(_)~oOOo~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
>
>
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple
>
>


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019