Compiler-assisted maximum stack usage measurement technique for efficient multi-threading in memory-limited embedded systems

Sung Ho Park, Dong Kyu Lee, Soon Ju Kang

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

5 Scopus citations

Abstract

One of the reasons why it is hard to use multi-threading in memory-limited embedded systems is the difficulty of stack optimization. Some solutions for this problem have been proposed in prior research, but the proposed solutions were not totally effective. This paper proposes the compiler-assisted maximum stack usage measurement technique as a new solution for this problem. This technique measures the maximum stack usage of each thread with special code that is automatically inserted at the beginning of each function by the compiler. With the help of the operating system, the special code records the maximum stack usage of each thread in run-time. Also, the special code predicts and prevents stack overflow in run-time. Therefore, with this technique, the maximum stack usage of each thread can be precisely determined during testing, and thus allowing the stack of each thread to be accurately optimized. Unlike the solutions proposed in previous research, this technique does not have problems such as limited availability, the possibility of undetectable stack usage, and memory fragmentation. Although this technique adds some overhead, the overhead is added only during the stack optimization process in the development phase. Also, despite the necessity for modification of the compiler and operating system, this technique is easy to implement. It can be implemented by slight modification of the existing compiler and operating system. To verify this technique, it was implemented and evaluated on the ARM platform by modifying the GNU ARM C compiler and the Ubinos, which is an operating system for memory-limited embedded systems.

Original languageEnglish
Title of host publicationComputers,Networks, Systems, and Industrial Engineering 2011
EditorsRoger Lee, Yung-Cheol Byun, Kiumi Akingbehin
Pages113-129
Number of pages17
DOIs
StatePublished - 2011

Publication series

NameStudies in Computational Intelligence
Volume365
ISSN (Print)1860-949X

Fingerprint

Dive into the research topics of 'Compiler-assisted maximum stack usage measurement technique for efficient multi-threading in memory-limited embedded systems'. Together they form a unique fingerprint.

Cite this