[En-Nut-Discussion] Ideas about possible banked memory usage on Ethernut 2.1 boards

Nathan Moore nategoose at gmail.com
Tue Mar 11 22:56:19 CET 2008


The worst hurdle is that a lot of stuff is written to assume that a pointer
always points to
the same RAM and that you can pass that pointer to other threads and they
will be able
to see the one and only location that that pointer points to.

>
> 4) Enhance utilization of the "private" heaps
>
> A final step could be to allocate the thread's stacks within the "private"
> heap. This could be done by a modified "NutThreadCreateBanked" function,
> which uses a currently unassigned memory bank to create a private heap
> right
> during thread creation. The stack will then be allocated within the
> private
> heap, further relieving the main system heap from holding these stacks.
> Switching between private heaps becomes a mandatory function of
> NutThreadSwitch, because otherwise the threads could not access their
> "own"
> stack any more.


On AVR the stacks for threads are allocated out of the small amount
of internal ram which is faster than the external RAM (where the paged ram
is).  Process control blocks could probably live in paged ram, though.
Other stuff that could probably live their pretty safely are network buffers
and message queues.

Nathan



More information about the En-Nut-Discussion mailing list