Help: RTEMS Threads, Preemptation and Time slicing...

Paul Whitfield paulw at omnitronics.com.au
Thu Oct 28 02:19:19 UTC 2004


Ian Caddy wrote:
> Hi Alex,
> 
> If your threads are the same priority, pre-emption will not cause one of 
> them to stop, as it will only pre-empt for HIGHER priority threads.
> 
> In this case, you will need to configure these threads for round-robbin 
> (or timeslicing) to achieve what you are asking.

The example states and is in time slice  / Round robin mode.

> In saying that though, your system design should never, in practise, 
> consist of tasks that are continuously running as no other task of a 
> lower priority level will ever get to run in this sort of system.  A 
> normal system design will have tasks waiting on things from other tasks, 
> or if not, sleeps that allow the task to yield to lower priority tasks.

Indeed! I personally consider systems that need round robins
to work as broken (but that is just a personal preference!).


I have a few things that you could look at:

1) Is the compiler optimizing you test loops out of existence?

2) The default values for CONFIGURE_MICROSECONDS_PER_TICK (10000)
and CONFIGURE_TICKS_PER_TIMESLICE (50) will mean that your
task will only do a round robin every 0.5 seconds, perhaps this
is too slow?

Good Luck
Paul



More information about the users mailing list