• PUDN用户
    了解作者
  • Java
    开发工具
  • 269KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 46
    下载次数
  • 2009-06-13 10:20
    上传日期
⑴ 用C语言分别实现采用首次适应算法和最佳适应算法的动态分区分配过程alloc()和回收过程free()。其中,空闲分区通过空闲分区链来管理;在进行内存分配时,系统优先使用空闲区低端的空间。 ⑵ 假设初始状态下,可用的内存空间为640KB,并有下列的请求序列: &#61656 作业1申请130KB。 &#61656 作业2申请60KB。 &#61656 作业3申请100KB。 &#61656 作业2释放60KB。 &#61656 作业4申请200KB。 &#61656 作业3释放100KB。 &#61656 作业1释放130KB。 &#61656 作业5申请140KB。 &#61656 作业6申请60KB。 &#61656 作业7申请50KB。 &#61656 作业6释放60KB。 分别采用首次适应算法和最佳适应算法进行内存块的分配和回收,要求每次分配和回收后显示出空闲内存分区链的情况。
Dynamic_partitioning_of_the_simulated_distribution
  • Dynamic_partitioning_of_the_simulated_distribution_patterns.doc
    415.5KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/626908774f8811599e1b836f/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/626908774f8811599e1b836f/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">&#35838;&#31243;&#21517;&#31216;<span class="ff2"> <span class="_ _0"></span> <span class="_ _1"> </span> <span class="_ _2"></span> <span class="_ _3"> </span> <span class="ff1">&#35745;&#31639;&#26426;&#25805;&#20316;&#31995;&#32479;<span class="_ _4"></span><span class="ff2"> <span class="_ _5"> </span> <span class="_ _6"></span> <span class="_ _7"> </span> <span class="ff1">&#25104;&#32489;&#35780;&#23450;</span> <span class="_ _8"></span> <span class="_"> </span> <span class="_ _9"></span> <span class="_ _a"></span> <span class="_ _b"> </span> <span class="_ _c"></span> <span class="_ _c"></span> </span></span></span></div><div class="t m0 x1 h3 y3 ff1 fs0 fc0 sc0 ls0 ws0">&#23454;&#39564;&#39033;&#30446;&#21517;&#31216;<span class="ff2"> <span class="_ _0"></span> <span class="_ _1"> </span> <span class="ff1">&#21160;&#24577;&#20998;&#21306;&#20998;&#37197;&#26041;&#24335;&#30340;&#27169;&#25311;<span class="_ _d"></span><span class="ff2"> <span class="_ _e"> </span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="fs1"> <span class="_ _f"></span><span class="fs0"> <span class="_ _10"> </span> <span class="ff1">&#25351;&#23548;&#25945;&#24072;</span> </span></span></span></span></span></div><div class="t m0 x1 h3 y4 ff1 fs0 fc0 sc0 ls0 ws0">&#23454;&#39564;&#39033;&#30446;&#32534;&#21495;<span class="ff2"> <span class="_ _9"></span> <span class="_ _11"></span> <span class="_ _12"> </span> <span class="ff1">&#23454;&#39564;&#39033;&#30446;&#31867;&#22411;</span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="ff1">&#39564;&#35777;<span class="_ _13"></span><span class="ff2"> <span class="_ _14"> </span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="ff1">&#23454;&#39564;&#22320;&#28857;</span> <span class="_ _9"></span> <span class="_ _2"></span> <span class="_ _3"> </span> <span class="_ _8"></span> <span class="_"> </span> </span></span></span></div><div class="t m0 x1 h3 y5 ff1 fs0 fc0 sc0 ls0 ws0">&#23398;&#29983;&#22995;&#21517;<span class="ff2"> <span class="_ _a"></span> <span class="_ _b"> </span> <span class="_ _9"></span> <span class="_ _9"></span> <span class="_ _15"></span> <span class="_ _16"> </span> <span class="_ _11"></span> <span class="_ _12"> </span> <span class="ff1">&#23398;&#21495;</span> <span class="_ _0"></span> <span class="_ _1"> </span> <span class="_ _17"></span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _8"></span> <span class="_"> </span> <span class="_ _11"></span> <span class="_ _12"> </span> <span class="_ _8"></span> <span class="_"> </span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _c"></span> </span></div><div class="t m0 x1 h3 y6 ff1 fs0 fc0 sc0 ls0 ws0">&#23398;&#38498;<span class="ff2"> <span class="_ _8"></span> <span class="_"> </span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _a"></span> <span class="_ _b"> </span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _9"></span> <span class="_ _9"></span> <span class="ff1">&#31995;</span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _18"></span> <span class="_ _19"> </span> <span class="_ _0"></span> <span class="_ _1"> </span> <span class="ff1">&#19987;&#19994;</span> <span class="_ _8"></span> <span class="_"> </span> <span class="_ _1a"></span> <span class="_ _1b"> </span> <span class="_ _c"></span> <span class="_ _c"></span> </span></div><div class="t m0 x1 h3 y7 ff1 fs0 fc0 sc0 ls0 ws0">&#23454;&#39564;&#26102;&#38388;<span class="ff2"> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _2"></span> <span class="_ _3"> </span> <span class="ff1">&#24180;</span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _9"></span> <span class="ff1">&#26376;</span> <span class="_ _c"></span> <span class="_ _c"></span> <span class="_ _9"></span> <span class="ff1">&#26085;</span> <span class="ff1">&#19978;&#21320;<span class="_ _13"></span> <span class="_ _1c"> </span> <span class="ff2"> <span class="_ _c"></span><span class="ff1"> <span class="_ _1d"></span> <span class="_ _1e"></span><span class="ff2"> <span class="ff1">&#28201;&#24230;</span> <span class="ff1">&#8451; &#28287;&#24230;</span> <span class="_ _8"></span> <span class="_"> </span> <span class="_ _9"></span> </span></span></span></span></span></div><div class="t m0 x1 h3 y8 ff1 fs0 fc0 sc1 ls0 ws0">&#19968;&#12289;&#23454;&#39564;&#30446;&#30340;</div><div class="t m0 x2 h4 y9 ff3 fs2 fc0 sc0 ls0 ws0">1<span class="ff1">&#65294;<span class="_ _1f"> </span>&#20102;&#35299;&#21160;&#24577;&#20998;&#21306;&#20998;&#37197;&#26041;&#24335;&#20013;&#20351;&#29992;&#30340;&#25968;&#25454;&#32467;&#26500;&#21644;&#20998;&#37197;&#31639;&#27861;&#65307;</span></div><div class="t m0 x2 h4 ya ff3 fs2 fc0 sc0 ls0 ws0">2<span class="ff1">&#65294;<span class="_ _1f"> </span>&#36827;&#19968;&#27493;&#21152;&#28145;&#23545;&#21160;&#24577;&#20998;&#21306;&#23384;&#20648;&#31649;&#29702;&#26041;&#24335;&#21450;&#20854;&#23454;&#29616;&#36807;&#31243;&#30340;&#29702;&#35299;&#12290;</span></div><div class="t m0 x1 h3 yb ff1 fs0 fc0 sc1 ls0 ws0">&#20108;&#12289;&#23454;&#39564;&#29615;&#22659;&#21450;&#35774;&#22791;</div><div class="t m0 x2 h4 yc ff2 fs2 fc0 sc0 ls0 ws0">1<span class="ff1">&#65294;<span class="_ _20"> </span>&#19968;&#21488;&#35013;&#26377;<span class="_ _21"> </span></span>Linux Ubuntu <span class="ff1">&#20013;&#25991;&#29256;&#25805;&#20316;&#31995;&#32479;&#30340;<span class="_ _21"> </span></span>PC<span class="_ _21"> </span><span class="ff1">&#26426;&#12290;</span></div><div class="t m0 x1 h3 yd ff1 fs0 fc0 sc1 ls0 ws0">&#19977;&#12289;&#23454;&#39564;&#20869;&#23481;</div><div class="t m0 x3 h4 ye ff3 fs2 fc0 sc0 ls0 ws0"> <span class="_ _22"></span><span class="ff1">&#9332;<span class="_ _23"> </span>&#29992;<span class="_"> </span><span class="ff3">C<span class="_"> </span></span>&#35821;<span class="_ _24"></span>&#35328;<span class="_ _24"></span>&#20998;<span class="_ _24"></span>&#21035;<span class="_ _24"></span>&#23454;<span class="_ _24"></span>&#29616;<span class="_ _25"></span>&#37319;<span class="_ _24"></span>&#29992;<span class="_ _25"></span>&#39318;<span class="_ _24"> </span>&#27425;<span class="_ _24"></span>&#36866;<span class="_ _24"></span>&#24212;<span class="_ _24"></span>&#31639;<span class="_ _24"></span>&#27861;<span class="_ _25"></span>&#21644;<span class="_ _24"> </span>&#26368;<span class="_ _24"></span>&#20339;<span class="_ _24"></span>&#36866;<span class="_ _24"></span>&#24212;<span class="_ _24"></span>&#31639;<span class="_ _25"></span>&#27861;<span class="_ _24"> </span>&#30340;<span class="_ _24"></span>&#21160;<span class="_ _24"></span>&#24577;<span class="_ _24"></span>&#20998;<span class="_ _24"></span>&#21306;<span class="_ _25"></span>&#20998;<span class="_ _24"> </span>&#37197;<span class="_ _24"></span>&#36807;<span class="_ _24"></span>&#31243;</span></div><div class="t m0 x1 h4 yf ff3 fs2 fc0 sc0 ls0 ws0">alloc<span class="ff1">&#65288;&#65289;&#21644;&#22238;&#25910;&#36807;&#31243;<span class="_ _21"> </span></span>free<span class="ff1">&#65288;&#65289;&#12290;&#20854;&#20013;&#65292;&#31354;&#38386;&#20998;&#21306;&#36890;&#36807;&#31354;&#38386;&#20998;&#21306;&#38142;&#26469;&#31649;&#29702;&#65307;&#22312;&#36827;&#34892;&#20869;&#23384;&#20998;&#37197;</span></div><div class="t m0 x1 h4 y10 ff1 fs2 fc0 sc0 ls0 ws0">&#26102;&#65292;&#31995;&#32479;&#20248;&#20808;&#20351;&#29992;&#31354;&#38386;&#21306;&#20302;&#31471;&#30340;&#31354;&#38388;&#12290;</div><div class="t m0 x4 h4 y11 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="_ _26"></span><span class="ff1">&#9333;<span class="_ _27"> </span>&#20551;&#35774;&#21021;&#22987;&#29366;&#24577;&#19979;&#65292;&#21487;&#29992;&#30340;&#20869;&#23384;&#31354;&#38388;&#20026;<span class="_ _21"> </span><span class="ff3">640KB</span>&#65292;&#24182;&#26377;&#19979;&#21015;&#30340;&#35831;&#27714;&#24207;&#21015;&#65306;</span></div><div class="t m0 x5 h4 y12 ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">1<span class="_ _21"> </span></span>&#30003;&#35831;<span class="_ _21"> </span><span class="ff3">130KB</span>&#12290;</span></div><div class="t m0 x5 h4 y13 ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">2<span class="_ _21"> </span></span>&#30003;&#35831;<span class="_ _21"> </span><span class="ff3">60KB</span>&#12290;</span></div><div class="t m0 x5 h4 y14 ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">3<span class="_ _21"> </span></span>&#30003;&#35831;<span class="_ _21"> </span><span class="ff3">100KB</span>&#12290;</span></div><div class="t m0 x5 h4 y15 ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">2<span class="_ _21"> </span></span>&#37322;&#25918;<span class="_ _21"> </span><span class="ff3">60KB</span>&#12290;</span></div><div class="t m0 x5 h4 y16 ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">4<span class="_ _21"> </span></span>&#30003;&#35831;<span class="_ _21"> </span><span class="ff3">200KB</span>&#12290;</span></div><div class="t m0 x5 h4 y17 ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">3<span class="_ _21"> </span></span>&#37322;&#25918;<span class="_ _21"> </span><span class="ff3">100KB</span>&#12290;</span></div><div class="t m0 x5 h4 y18 ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">1<span class="_ _21"> </span></span>&#37322;&#25918;<span class="_ _21"> </span><span class="ff3">130KB</span>&#12290;</span></div><div class="t m0 x5 h4 y19 ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">5<span class="_ _21"> </span></span>&#30003;&#35831;<span class="_ _21"> </span><span class="ff3">140KB</span>&#12290;</span></div><div class="t m0 x5 h4 y1a ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">6<span class="_ _21"> </span></span>&#30003;&#35831;<span class="_ _21"> </span><span class="ff3">60KB</span>&#12290;</span></div><div class="t m0 x5 h4 y1b ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">7<span class="_ _21"> </span></span>&#30003;&#35831;<span class="_ _21"> </span><span class="ff3">50KB</span>&#12290;</span></div><div class="t m0 x5 h4 y1c ff4 fs2 fc0 sc0 ls0 ws0">&#61656;<span class="_ _28"> </span><span class="ff1">&#20316;&#19994;<span class="_ _21"> </span><span class="ff3">6<span class="_ _21"> </span></span>&#37322;&#25918;<span class="_ _21"> </span><span class="ff3">60KB</span>&#12290;</span></div><div class="t m0 x6 h4 y1d ff1 fs2 fc0 sc0 ls0 ws0">&#20998;&#21035;<span class="_ _17"></span>&#37319;&#29992;&#39318;<span class="_ _17"></span>&#27425;&#36866;<span class="_ _17"></span>&#24212;&#31639;&#27861;<span class="_ _17"></span>&#21644;&#26368;<span class="_ _17"></span>&#20339;&#36866;<span class="_ _17"></span>&#24212;&#31639;&#27861;<span class="_ _17"></span>&#36827;&#34892;<span class="_ _17"></span>&#20869;&#23384;&#22359;<span class="_ _17"></span>&#30340;&#20998;<span class="_ _17"></span>&#37197;&#21644;<span class="_ _17"></span>&#22238;&#25910;&#65292;<span class="_ _17"></span>&#35201;&#27714;&#27599;<span class="_ _17"></span>&#27425;&#20998;<span class="_ _17"></span>&#37197;&#21644;<span class="_ _17"></span>&#22238;</div><div class="t m0 x1 h4 y1e ff1 fs2 fc0 sc0 ls0 ws0">&#25910;&#21518;&#26174;&#31034;&#20986;&#31354;&#38386;&#20869;&#23384;&#20998;&#21306;&#38142;&#30340;&#24773;&#20917;&#12290;</div><div class="t m0 x1 h3 y1f ff1 fs0 fc0 sc1 ls0 ws0">&#22235;&#12289;&#35843;&#35797;&#20998;&#26512;</div><div class="t m0 x7 h4 y20 ff1 fs2 fc0 sc0 ls0 ws0">&#20026;&#20102;&#23454;&#29616;&#21160;&#24577;&#20998;&#21306;&#20998;&#37197;&#26041;&#24335;&#30340;&#27169;&#25311;&#65292;&#26412;&#23454;&#39564;&#30340;&#31243;&#24207;&#37319;&#29992;&#32447;&#24615;&#34920;&#30340;&#21452;&#21521;&#38142;&#34920;&#23384;&#20648;&#32467;&#26500;&#26469;</div><div class="t m0 x1 h4 y21 ff1 fs2 fc0 sc0 ls0 ws0">&#27169;&#25311;<span class="_ _17"></span>&#31649;&#29702;<span class="_ _17"></span>&#20869;&#23384;&#30340;<span class="_ _17"></span>&#31354;&#38386;<span class="_ _17"></span>&#20998;&#21306;&#12290;<span class="_ _17"></span>&#21452;<span class="_ _17"></span>&#21521;&#38142;&#34920;<span class="_ _17"></span>&#30340;&#27599;<span class="_ _17"></span>&#20010;&#32467;&#28857;<span class="_ _17"></span>&#30001;&#19977;<span class="_ _17"></span>&#20010;&#20803;<span class="_ _17"></span>&#32032;&#26500;&#25104;<span class="_ _17"></span>&#65306;&#25968;&#25454;<span class="_ _17"></span>&#22495;&#65292;<span class="_ _17"></span>&#21069;&#36235;<span class="_ _17"></span>&#25351;&#38024;<span class="_ _17"></span>&#65292;&#21518;</div><div class="t m0 x1 h4 y22 ff1 fs2 fc0 sc0 ls0 ws0">&#32487;&#25351;&#38024;&#12290;&#20854;&#20013;&#25968;&#25454;&#22495;&#30001;&#35813;&#32467;&#28857;&#25152;&#34920;&#31034;&#20998;&#21306;&#30340;&#20998;&#21306;&#21495;<span class="_ _29"> </span><span class="ff3">ID</span>&#12289;&#20998;&#21306;&#22823;&#23567;<span class="_ _21"> </span><span class="ff3">size</span>&#12289;&#20998;&#21306;&#22320;&#22336;<span class="_ _21"> </span><span class="ff3">address</span></div><div class="t m0 x1 h4 y23 ff1 fs2 fc0 sc0 ls0 ws0">&#21644;&#29366;&#24577;<span class="_ _21"> </span><span class="ff3">state<span class="_ _21"> </span></span>&#32452;&#25104;&#12290;</div><div class="t m0 x7 h4 y24 ff1 fs2 fc0 sc0 ls0 ws0">&#39318;&#20808;<span class="_ _17"></span>&#65292;&#23450;&#20041;<span class="_ _17"></span>&#20869;&#23384;<span class="_ _17"></span>&#20998;&#37197;&#20989;<span class="_ _17"></span>&#25968;<span class="_ _29"> </span><span class="ff3">all<span class="_ _17"></span>oc( )</span>&#12290;<span class="_ _17"></span>&#35813;&#20989;<span class="_ _17"></span>&#25968;&#23558;<span class="_ _17"></span>&#25552;&#31034;<span class="_ _17"></span>&#29992;&#25143;&#36755;<span class="_ _17"></span>&#20837;&#20316;&#19994;<span class="_ _25"></span><span class="ff3">(</span>&#20998;<span class="_ _17"></span>&#21306;&#21495;<span class="_ _17"></span><span class="ff3">)</span>&#21644;<span class="_ _17"></span>&#38656;&#35201;&#20998;<span class="_ _17"></span>&#37197;</div><div class="t m0 x1 h4 y25 ff1 fs2 fc0 sc0 ls0 ws0">&#30340;&#20027;&#23384;&#22823;&#23567;<span class="ff3">(</span>&#21333;&#20301;<span class="ff3">:KB)</span>&#65292;&#28982;&#21518;&#26681;&#25454;&#29992;&#25143;&#36873;&#25321;&#30340;&#19981;&#21516;&#31639;&#27861;&#65288;&#21363;&#39318;&#27425;&#36866;&#24212;&#31639;&#27861;&#21644;&#26368;&#20339;&#36866;&#24212;&#31639;&#27861;&#65289;</div><div class="t m0 x1 h4 y26 ff1 fs2 fc0 sc0 ls0 ws0">&#32780;&#35843;&#29992;&#30456;&#24212;&#30340;&#31639;&#27861;&#20989;&#25968;&#12290;</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐