public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] Thread activation disturbed by lower priority threads]
@ 2007-08-17  7:34 Alois Z.
  2007-08-17  8:08 ` Pieter-Jan Busschaert
  0 siblings, 1 reply; 14+ messages in thread
From: Alois Z. @ 2007-08-17  7:34 UTC (permalink / raw)
  To: ecos-discuss

Hi,
> 
> How many mutex's does your lower priority thread hold? From
> packages/kernel/current/src/sched/sched.cxx
> 
> void Cyg_SchedThread::clear_inherited_priority()
> {
>     CYG_REPORT_FUNCTION();
> 
> #ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_SIMPLE
> 
>     // A simple implementation of priority inheritance/ceiling
>     // protocols.  The simplification in this algorithm is that we do
>     // not reduce our priority until we have freed all mutexes
>     // claimed. Hence we can continue to run at an artificially high
>     // priority even when we should not.  However, since nested
>     // mutexes are rare, the thread we have inherited from is likely
>     // to be locking the same mutexes we are, and mutex claim periods
>     // should be very short, the performance difference between this
>     // and a more complex algorithm should be negligible. The most
>     // important advantage of this algorithm is that it is fast and
>     // deterministic.
> 
> Does this explain what you see?
>     
I should have always only one mutex claimed per thread. And always only for a very short period. What if several threads waiting for one mutex with priorities from 2 to 6 and the tread with priority 7 is holding the mutex. First of all will there be a reschedule after the mutex is realeased? 

Alois

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [ECOS] Thread activation disturbed by lower priority threads]
@ 2007-08-07 14:02 Alois Z.
  2007-08-07 14:41 ` Andrew Lunn
  0 siblings, 1 reply; 14+ messages in thread
From: Alois Z. @ 2007-08-07 14:02 UTC (permalink / raw)
  To: ecos-discuss

Hi, 

as I got no response to me questions (see below) I may have to add a few things for clarification.

First of all I'm running an an AT91M5580A processor (thy phytec board). I changed the ecos settings so that the timer tick is now 1ms. The reason for this is that I need such a small tick for my application. Does this anyhow influence the scheduling algorithm. Are there settings that need to be adjusted appart from denominator, nominator and timesclice value?

I did more measurements and found out that the timer DSR is really stable. even more stable than on some other systems (non ecos) I'm using. The problem is that the time between posting on the semaphore (the thread is waiting on) until the thread starts executing  is varying largly. It seems that it is prolonged by other execution elements. And this even when the thread under question is the thread with the highest priority.

would be great if this clearifies my problem a little bit more.

Thanks,
Alois

Hi,

In a larger project I have a problem when doing a timed activation of threads.

In the timer alarm handler I check if any thread is ready for activation and post on a semaphore the thread is waiting for.

This works fine when I have only one or two such timed threads the activation jitter of the thread (i.e. the jitter when the threads starts its execution) is ok. But when I add more threads this jitter grows tremendously. Each thread has an own priority. And event the thread with with the highest priority (in my case 2) has this large jitter (more than half of the cycle time).

Is there a way to improve the behavior of the activation. Do I the timed activation the wrong way. Can I improve the timing behavior of the scheduler through the real-time clock settings.

By the way I use the multilevel scheduler.

Thanks,
Alois



-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-08-23 20:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-17  7:34 [ECOS] Thread activation disturbed by lower priority threads] Alois Z.
2007-08-17  8:08 ` Pieter-Jan Busschaert
2007-08-17  8:14   ` Andrew Lunn
2007-08-17  8:46     ` Pieter-Jan Busschaert
2007-08-17  8:59       ` Andrew Lunn
2007-08-23 20:38   ` Alois Zoitl
  -- strict thread matches above, loose matches on Subject: below --
2007-08-07 14:02 Alois Z.
2007-08-07 14:41 ` Andrew Lunn
2007-08-07 17:35   ` Paul D. DeRocco
2007-08-07 18:55     ` Andrew Lunn
     [not found]   ` <20070808075810.250840@gmx.net>
2007-08-08  8:10     ` Andrew Lunn
2007-08-16 20:05       ` Alois Zoitl
2007-08-16 20:22         ` Andrew Lunn
     [not found]           ` <20070817072849.22110@gmx.net>
2007-08-17  8:08             ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).