rtems_iterate_over_all_threads

Thomas Dörfler Thomas.Doerfler at imd-systems.de
Wed Apr 22 16:07:17 UTC 2009


Leon,

Leon Pollak wrote:
> On Wednesday April 22 2009, Thomas Dörfler wrote:
> 
>> On the other hand, I consider using nested suspend/resume
>> to control the task scheduling as a bad practice which may lead to
>> unexpected behaviour in bigger RTEMS systems. So I would not ecourage
>> people to do so by making the API more feature-rich.
> Thomas,
> As I highly appreciate your qualification and experience, which are bigger and 
> wider then mine, I am ready to accept your objection.

I really doubt that I have a bigger experience than you have, and please
 don't take my critics against your proposal personally.

> But why this option exists in other APIs?

Here you have caught me. This is a weak point in my position. :-)

> And why do you think this is a bad practice?

I think RTEMS has several methods to control, when a task should execute
and when it shouldn't. Most of them are synchronous to each task's
probgram flow (e.g. semaphores, waiting for events etc).

Suspending a task from outside almost always means that you don't know
the state this task is in when you suspend it. And if even multiple
"control" tasks would suspend/resume arbitrary other tasks, you (no: I!)
would soon loose track when which task is suspended...

Consider your current problem: If I got you right, you want to make
sure, that no other task is executed even when your task is waiting
during I/O. Let's assume you use a serial termios channel for console
output. If you suspend another task, while it is somewhere deep in
termios, this task may even hold the output semaphore you are waiting on
to get control of the output channel.

In short: you can never be sure in which state you actually suspend a task.

This is why I consider it bad practice to control other tasks via
suspend/resume.

Nevertheless: There MAY be reasons to do so....

wkr,
Thomas.

> 
> 
> Thanks.
> Leon
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users


-- 
--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at:
     http://www.imd-systems.de/pgpkey_en.html



More information about the users mailing list