<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Console'; font-size:12pt; font-weight:400; font-style:normal;">On Wednesday April 22 2009, Thomas Dörfler wrote:<br>
> I really doubt that I have a bigger experience than you have, and please<br>
> don't take my critics against your proposal personally.<br>
I respect you enough not to do this...:-)<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>> I think RTEMS has several methods to control, when a task should execute<br>
> and when it shouldn't. Most of them are synchronous to each task's<br>
> probgram flow (e.g. semaphores, waiting for events etc).<br>
><br>
> Suspending a task from outside almost always means that you don't know<br>
> the state this task is in when you suspend it. And if even multiple<br>
> "control" tasks would suspend/resume arbitrary other tasks, you (no: I!)<br>
> would soon loose track when which task is suspended...<br>
><br>
> Consider your current problem: If I got you right, you want to make<br>
> sure, that no other task is executed even when your task is waiting<br>
> during I/O. Let's assume you use a serial termios channel for console<br>
> output. If you suspend another task, while it is somewhere deep in<br>
> termios, this task may even hold the output semaphore you are waiting on<br>
> to get control of the output channel.<br>
><br>
> In short: you can never be sure in which state you actually suspend a task.<br>
><br>
> This is why I consider it bad practice to control other tasks via<br>
> suspend/resume.<br>
Well, I should intend to agree with you in general.<br>
But still, these commands 9suspend/resume) exist in the API and people (like me) use them.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>OK, we (users of s/r) need to be careful to avoid the case you described, but still be able to do what we want.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Just now, it is a serious problem for me:<br>
I have an urgent job to be done, which can not be interrupted by other I/O and processing tasks despite the state they reside in. I can not block interrupts and task switching at all, as the urgent task must do some processing requiring these facilities.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>When the urgent job finishes, I should like to return to the normal processing, which has been interrupted.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Just now, I can not, as previously suspended tasks will be resumed by exiting from the urgent task.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>May be you see some other way to do this?<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Many thanks.<br>
Leon</p></body></html>