[En-Nut-Discussion] Max number of threads in Ethernut 3.1

Harald Kipp harald.kipp at egnite.de
Tue Mar 23 12:43:35 CET 2010


Fernando Me Ga wrote:

> I am implementing multithreads in Ethernut 3.1 but I am not sure about
> de max number of them you can create. Otherwise, is NutThreadKill();
> actualy releasing all memory used in the thread?

The number of threads is limited by available RAM only. Use
NutHeapAvailable() to check this.

NutThreadKill will remove all memory occupied by the kernel when
creating a thread. In fact this is done by the idle thread.

Any heap memory allocated by your application must be released by the
application. This includes closing open files etc.

To check this, you may enable NUTDEBUG_HEAP in the Configurator and
rebuild Nut/OS. Within your application you can call NutHeapDump(stdout)
to get a dump of all used heap fragments, including the information,
where they had been allocated.

http://old.nabble.com/New-debugging-capabilities-of-Nut-OS-4.8-td22935113.html
(No need to modify UserConf.mk anymore, it's configurable in Configurator.)

Harald




More information about the En-Nut-Discussion mailing list