[En-Nut-Discussion] Thread management (killing threads)

Moritz 'Morty' Struebe Moritz.Struebe at informatik.uni-erlangen.de
Tue Jul 7 11:20:31 CEST 2009


Hi Rob,

the main problem with killing threads is the memory management. You need
to know which memory was allocated to which thread, so you can free it
when you kill a thread. About a year ago I've written some code to do
this and also sent some patches which partly made it into the Nut/OS
codebase. If you are interested I can search that code. Shouldn't be too
much trouble to add it to the current codebase, as HEAPNODE ist now used
everywhere.
Basically you have to add an thread-element and a next-element to
HEAPNODE. When allocating you write current-thread to the memory and
link it into the list (as with the debug-code). When killing a thread
you need to walk the list and free all memory which isn't needed any more.

I can also send you my Diploma Theses, which also describes this
problem. It's in German, though.

Morty




Am 07.07.2009 10:39, schrieb PragmaLab:
> Hi all,
>
>
> So:
>
> - is anyone there using threadmanagement in a more dynamic way?
> - is anyone using 'NutThreadKill()' with more succes?
>
> Thanks for you time and answers....
>
> Regards,
>
> Rob van Lieshout
>
>  
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>   


-- 
Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter)
Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme)
Friedrich-Alexander-Universität Erlangen-Nürnberg
Martensstr. 1
91058 Erlangen

WWW          : http://www4.informatik.uni-erlangen.de/~morty
eMail        : struebe at informatik.uni-erlangen.de






More information about the En-Nut-Discussion mailing list