摘要
针对用现有方法较难确定μC/OS-Ⅱ任务栈空间大小的问题,提出了基于树结构计算μC/OS-Ⅱ任务栈空间的方法。分析了任务栈空间结构,定义了能够表示栈空间最坏使用情况的树结构,提出了用树结构计算最坏情况下栈空间的计算公式,并计算了一个实际系统的栈空间。用该方法确定的任务栈空间能够准确地反映任务栈空间的最坏使用情况,同时还能够节约内存的使用。
Aiming at the problem that the stack space size of μC/OS-Ⅱ task is not easily confirmed by existing ways, this paper presented a new way by which the stack space size of μC/OS-Ⅱ task can be computed based on tree structure. Firstly, the stack space structure of μC/OS-Ⅱ task was analyzed. Secondly, some tree structures that can show the extreme usage of the stack space were defined. Lastly, the formula that can calculate the stack space which is maximal was presented based on tree structure and the stack space of a real system was calculated by the formula. The stack space size which is calculated by this way can reflect the extreme usage of a stack space factually and can reduce the requirement for RAM.
出处
《计算机应用》
CSCD
北大核心
2009年第4期1165-1167,共3页
journal of Computer Applications
基金
重庆市自然科学基金资助项目(CSTC2007BB2409)