[riot-notifications] [RIOT-OS/RIOT] Single tasking (#11226)

Marian Buschsieweke notifications at github.com
Thu Mar 21 12:38:36 CET 2019


> The bss memory isn't saved, as it is mostly stack memory, which in the single-task case is not displayed.

This only partly true. The idle-thread is gone and so is the stack of the idle thread. Also the scheduler requires > 100B RAM with multi-tasking, and 2B / 4B (AVR/ARM) in single-threading.

E.g. on ARM Cortex M `THREAD_STACKSIZE_DEFAULT` is 1024B, but bss was reduced by 2000B. For ATmega `THREAD_STACKSIZE_DEFAULT` is 512B, but 706B less RAM (bss+data) is required.

> Why is it twice as much on avr?

This is a good question. I didn't touch any platform specific code and did not look into any. If I had to guess, I would bet that the compiler was able to identify unreachable code in AVR in the single-tasked version, that is used by the scheduler in the multi-tasked version.

> is that worth the extra complexity?

The stats on this PR look more frightening that the changes actually are. E.g. by splitting up `core/include/thread.h` into `core/include/thread.h`, `core/multi_tasking/thread.h` and `core/single_tasking/thread.h` the boiler plate code (license, doxygen, C++ compatibility) is thrice now. The actual code change are trivial.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11226#issuecomment-475196917
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190321/b940bfa5/attachment.html>


More information about the notifications mailing list