[mkc2007] thread halt/resume
Torsten Frenzel
frenzel at os.inf.tu-dresden.de
Wed May 9 19:22:15 CEST 2007
Benjamin Engel(be020578 at inf.tu-dresden.de)@2007.05.09 18:16:48 +0200:
> Hi,
>
> I would like to know how to make a thread *not ready*. I tried to add a
> function like halt_myself(), looked up the thread, invoked that function
> and did a state_del( Thread_ready ) and ready_dequeue() from within.
> after that i did a schedule() if the thread wants to halt itself.
>
> Scheduling continued and the next time the halted thread was
> considered as next_to_run it's state was still ready - why?
>
Its hard to tell what's wrong without looking at the code. First you don't
need to look up yourself because you are running in your own thread context.
> Additionally i would like to know what will/should happen if a thread is
> halted and gets an ipc. I would prefer that it stays halted and blocks
> the other thread as well - if this is possible/reasonable. Similarly a
> thread *doing* ipc that is being halted should stay out of the ready
> queue until it is resumed, therefore staying within its ipc handling for
> a very long time. how to do that or is this unreasonable?
>
If you refer to the practical excercises 2.1 then the halted thread
stays halted even if it gets an IPC an the sender/receiver gets blocked.
ciao
Torsten
Email: frenzel at os.inf.tu-dresden.de
Web: http://os.inf.tu-dresden.de/
More information about the mkc2007
mailing list