<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 多線程編程之:Linux線程編程

          多線程編程之:Linux線程編程

          作者: 時間:2013-09-13 來源:網(wǎng)絡(luò) 收藏


          本文引用地址:http://www.ex-cimer.com/article/257101.htm

          接下來可以在線程運行前后使用“free”命令查看內(nèi)存的使用情況。以下是運行結(jié)果:


          $ ./thread_attr

          Create tread success

          Waiting for thread to finish...

          Thread is starting

          Waiting for thread to finish...

          Thread : job 0 delay = 3

          Waiting for thread to finish...

          Thread : job 1 delay = 2

          Waiting for thread to finish...

          Waiting for thread to finish...

          Waiting for thread to finish...

          Waiting for thread to finish...

          Thread : job 2 delay = 9

          Thread finished


          /* 程序運行之前 */

          $ free

          total used free shared buffers cached

          Mem: 255556 191940 63616 10 5864 61360

          -/+ buffers/cache: 124716 130840

          Swap: 377488 18352 359136


          /* 程序運行之中 */

          $ free

          total used free shared buffers cached

          Mem: 255556 191948 63608 10 5888 61336

          -/+ buffers/cache: 124724 130832

          Swap: 377488 18352 359136


          /* 程序運行之后 */

          $ free

          total used free shared buffers cached

          Mem: 255556 191940 63616 10 5904 61320

          -/+ buffers/cache: 124716 130840

          Swap: 377488 18352 359136


          可以看到,線程在運行結(jié)束后就收回了系統(tǒng)資源,并釋放內(nèi)存。

          linux操作系統(tǒng)文章專題:linux操作系統(tǒng)詳解(linux不再難懂)

          linux相關(guān)文章:linux教程



          上一頁 1 2 3 4 5 6 7 8 下一頁

          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();