uc-os-ii任务栈处理的一种改进方法--电子门.htm
来自「ucos的资料以及单片机dsp的经典移植程序」· HTM 代码 · 共 715 行 · 第 1/3 页
HTM
715 行
style="TEXT-INDENT: 30px">独立任务栈的方法适合于存储器充足、任务切换频繁、对任务切换时间要求较高的场合,一般主要用在16位或者32位微处理器平台环境。值得注意的是,在某些微处理器中,虽然可使用的数据存储器可以设计得较大,但堆栈所能使用的存储器却是有限的。比如8031系列存储器,堆栈只能使用内部的128字节数据存储器,即使系统中有64K字节的外部数据存储器,任务栈的总空间也不能超过128字节。这种处理器使用共用任务栈结构的RTOS就更好一些。</P>
<P class=p4
style="TEXT-INDENT: 30px">由于共用任务栈系统需要较长的任务切换时间,不适于任务切换频繁的场合,在很多嵌入式系统中,长时间只有几个任务会处于运行状态,其它任务在特定的条件下才会运行。对于RTOS的使用者,也可以适当地划分任务,来减小任务切换的时间。</P>
<P class=p4
style="TEXT-INDENT: 30px">无论使用哪种方法,在存储空间有限时,任务栈的长度应仔细计算。计算的根据是任务中的函数嵌套数、函数局部变量长度。对于共用任务栈,还要考虑同时运行态和挂起态的最大任务数。一些编译器可以生成堆栈溢出检查代码,在调试时可将该编译开关打开,以测试需要的实际堆栈长度。</P></SPAN></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD height=3> </TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD class=seyle5 height=13>
<DIV align=right><SPAN class=textbox-urls><A
href="http://www.mcublog.com/blog/user1/7610/archives/2006/10724.html#">阅读全文<SPAN
id=ob_logreaded></SPAN></A> | <A
href="http://www.mcublog.com/blog/user1/7610/archives/2006/10724.html#cmt">回复(0)</A>
<SPAN id=ob_logm10724></SPAN>| <A
href="http://www.mcublog.com/blog/showtb.asp?id=10724"
target=_blank>引用通告<SPAN id=ob_tbnum></SPAN></A> |
<A
href="http://www.mcublog.com/blog/user_post.asp?logid=10724"
target=_blank>编辑</A></SPAN></DIV></TD></TR></TBODY></TABLE>
<TABLE height=14 cellSpacing=0 cellPadding=0
width="100%" align=center border=0>
<TBODY>
<TR>
<TD> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<DIV id=morelog>
<UL>
<LI>上一篇:<A
href="http://www.mcublog.com/blog/user1/7610/archives/2006/10723.html">uC/OS-II的特点</A>
<LI>下一篇:<A
href="http://www.mcublog.com/blog/user1/7610/archives/2006/10725.html">rtems: rtems中的单调周期调度基础</A>
</LI></UL></DIV>
<DIV id=form_comment>
<DIV id=gg_usercomment></DIV><A name=cmt></A>
<DIV class=title>发表评论:</DIV>
<FORM id=commentform name=commentform
onsubmit="return Verifycomment()"
action=/blog/savecomment.asp?logid=10724 method=post>
<DIV class=d1><LABEL>昵称:<INPUT id=UserName maxLength=20
name=UserName></LABEL></DIV>
<DIV class=d2><LABEL>密码:<INPUT id=Password type=password
maxLength=20 name=Password> (游客无须输入密码)</LABEL></DIV>
<DIV class=d3><LABEL>主页:<INPUT id=homepage maxLength=50
size=42 value=http:// name=homepage></LABEL></DIV>
<DIV class=d4><LABEL>标题:<INPUT id=commenttopic maxLength=50
size=42 value=Re:uC/OS-II任务栈处理的一种改进方法
name=commenttopic></LABEL></DIV>
<DIV class=d5><INPUT id=edit type=hidden name=edit>
<DIV id=oblog_edit>MCU博客数据载入中, 请稍候...</DIV></DIV>
<DIV class=d6><SPAN id=ob_code></SPAN><INPUT onclick='oblog_edittext.createTextRange().execCommand("Copy");' type=submit value= 提 交 ></DIV></FORM></DIV></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top width=243>
<TABLE cellSpacing=0 cellPadding=0 width="99%"
background=uC-OS-II任务栈处理的一种改进方法--电子门.files/index_09.gif border=0>
<TBODY>
<TR>
<TD vAlign=top><BR>
<TABLE style="TABLE-LAYOUT: fixed; OVERFLOW: hidden"
cellSpacing=0 cellPadding=0 width="90%" align=center
border=0><TBODY>
<TR>
<TD>
<DIV id=placard>MCU博客数据载入中,
请稍候...</DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE class=table3 cellSpacing=0 cellPadding=0 width="99%"
align=center border=0>
<TBODY>
<TR>
<TD class=b2 align=middle height=43>时 间 记 忆</TD></TR>
<TR>
<TD align=middle>
<DIV class=content4>
<DIV id=calendar>MCU博客数据载入中,
请稍候...</DIV></DIV></TD></TR></TBODY></TABLE><!-- BEGIN: last_followups -->
<TABLE class=table3 cellSpacing=0 cellPadding=0 width="99%"
align=center border=0>
<TBODY>
<TR>
<TD class=b2 align=middle height=43>最 新 评 论</TD></TR><!-- BEGIN: followups_row -->
<TR>
<TD>
<DIV class=content4>
<DIV id=comment>MCU博客数据载入中, 请稍候...</DIV></DIV></TD></TR><!-- END: followups_row --></TBODY></TABLE><!-- END: last_followups -->
<TABLE class=table3 cellSpacing=0 cellPadding=0 width="99%"
align=center border=0>
<TBODY>
<TR>
<TD class=b2 align=middle height=43>专 题 分 类</TD></TR>
<TR>
<TD>
<DIV class=content4>
<DIV id=subject>MCU博客数据载入中,
请稍候...</DIV></DIV></TD></TR></TBODY></TABLE><!-- BEGIN: last_tb -->
<TABLE class=table3 cellSpacing=0 cellPadding=0 width="99%"
align=center border=0>
<TBODY>
<TR>
<TD class=b2 align=middle height=43>最 新 日 志</TD></TR>
<TR>
<TD>
<DIV class=content4><!-- BEGIN: tb -->
<DIV id=newblog>MCU博客数据载入中,
请稍候...</DIV><!-- END: tb --></DIV></TD></TR></TBODY></TABLE><!-- END: last_tb -->
<TABLE class=table3 cellSpacing=0 cellPadding=0 width="99%"
align=center border=0>
<TBODY>
<TR>
<TD class=b2 align=middle height=43>最 新 留 言</TD></TR>
<TR>
<TD>
<DIV class=content4>
<DIV id=newmessage>MCU博客数据载入中,
请稍候...</DIV></DIV></TD></TR></TBODY></TABLE>
<TABLE class=table3 cellSpacing=0 cellPadding=0 width="99%"
align=center border=0>
<TBODY>
<TR>
<TD class=b2 align=middle height=43>搜 索</TD></TR>
<TR>
<TD>
<DIV class=content4>
<DIV id=search>MCU博客数据载入中,
请稍候...</DIV></DIV></TD></TR></TBODY></TABLE>
<TABLE class=table3 cellSpacing=0 cellPadding=0 width="99%"
align=center border=0>
<TBODY>
<TR>
<TD class=b2 align=middle height=43>用 户 登 录</TD></TR>
<TR>
<TD align=middle>
<DIV class=content4>
<DIV id=ob_login>MCU博客数据载入中,
请稍候...</DIV></DIV></TD></TR></TBODY></TABLE><!-- BEGIN: link -->
<TABLE class=table3 cellSpacing=0 cellPadding=0 width="99%"
align=center border=0>
<TBODY>
<TR>
<TD class=b2 align=middle height=43>友 情 连 接</TD></TR>
<TR>
<TD>
<TABLE style="TABLE-LAYOUT: fixed; OVERFLOW: hidden"
cellSpacing=0 cellPadding=0 width="87%" align=center
border=0><TBODY>
<TR>
<TD class=b1>
<DIV id=links></DIV>
<DIV
id=gg_userlinks></DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE class=table3 cellSpacing=0 cellPadding=0 width="99%"
align=center border=0>
<TBODY>
<TR>
<TD class=b2 align=middle height=43>博 客 信 息</TD></TR>
<TR>
<TD>
<TABLE class=b1 cellSpacing=5 cellPadding=2 width="100%"
align=right border=0>
<TBODY>
<TR>
<TD class=b1 align=left>
<DIV id=info>MCU博客数据载入中, 请稍候...</DIV>
<DIV id=aobomusic></DIV></TD></TR>
<TR>
<TD class=b1 align=left>
<DIV id=xml><SPAN id=txml></SPAN><BR><BR><A
href="http://www.mcublog.com/blog/user1/7610/rss2.xml"
target=_blank><IMG height=14
src="uC-OS-II任务栈处理的一种改进方法--电子门.files/xml.gif" width=36
border=0></A></DIV></TD></TR>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-0269824239044964";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFCC66";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//-->
</SCRIPT>
<TR>
<TD <SCRIPT
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"
type="text/javascript"></SCRIPT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><!-- END: link --></TD></TR></TBODY></TABLE></TD></TD>
<TD vAlign=top width=126><IMG height=1115 alt=""
src="uC-OS-II任务栈处理的一种改进方法--电子门.files/index_03.jpg"
width=126></TD></TR></TBODY></TABLE>
<TABLE class=content6 cellSpacing=0 cellPadding=0 width=996 border=0>
<TBODY>
<TR>
<TD vAlign=top align=middle></TD></TR></TBODY>
<TBODY>
<TR>
<TD vAlign=top align=middle>
<TR>
<TD>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-0269824239044964";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
//-->
</SCRIPT>
<SCRIPT src="uC-OS-II任务栈处理的一种改进方法--电子门.files/show_ads.js"
type=text/javascript>
</SCRIPT>
</TD></TR></TBODY></TABLE><SPAN id=gg_userbot></SPAN>
<DIV id=powered><A href="http://www.oblog.cn/" target=_blank><IMG
alt="Powered by Oblog." src="uC-OS-II任务栈处理的一种改进方法--电子门.files/oblog_powered.gif"
border=0></A></DIV>
<SCRIPT src="uC-OS-II任务栈处理的一种改进方法--电子门.files/200604.htm"></SCRIPT>
<SCRIPT src="uC-OS-II任务栈处理的一种改进方法--电子门.files/count.htm"></SCRIPT>
<SCRIPT src="uC-OS-II任务栈处理的一种改进方法--电子门.files/commentedit.htm"></SCRIPT>
<SCRIPT src="F:\ucos\uC-OS-II任务栈处理的一种改进方法--电子门.files\count(1).htm"></SCRIPT>
<SCRIPT src="uC-OS-II任务栈处理的一种改进方法--电子门.files/login.htm"></SCRIPT>
<SCRIPT src="uC-OS-II任务栈处理的一种改进方法--电子门.files/ShowXml.htm"></SCRIPT>
<SCRIPT src="F:\ucos\uC-OS-II任务栈处理的一种改进方法--电子门.files\count(2).htm"></SCRIPT>
</BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?