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

PragmaLab info at pragmalab.nl
Wed Jul 8 16:08:04 CEST 2009


Hi Harald and Ole,

> > Just call NutThreadExit from the running thread or simply quit your 
> > endless loop. In this case NutOS will remove the running 
> thread from 
> > the memory as soon as it was ended.
> 
> Yes, and a related sample is available at 
> http://www.ethernut.de/nutwiki/Run_Once_Thread

Glad to hear that a methode is available. Just to be sure: with this method
no 'NutOS remainders' are left in RAM? Ofcourse the application itself is
responsible for freeiing the resources it claimed during executon of thread,
but it doesn't know about resources that the threadmanagement claimed. I
already figured out that the 'NUTTHREADINFO' structure is allocated in the
same block as the threadstack itself (and so altogether removed in one
action in 'NutThreadDestroy())'. 

In other words, no known memory leak issues when constantly creating and
killing the same thread ?

Thanks.

Regards,

Rob van Lieshout




More information about the En-Nut-Discussion mailing list