首页 | 本学科首页   官方微博 | 高级检索  
     

一种Linux多线程应用下内存池的设计与实现
引用本文:许健,于鸿洋.一种Linux多线程应用下内存池的设计与实现[J].电子技术应用,2012,38(11):146-149.
作者姓名:许健  于鸿洋
作者单位:电子科技大学 电子科学技术研究院,四川成都,611731
基金项目:广东省高新技术产业化项目
摘    要:对内存池中内存块获取、分配机制、内存块大小、内存释放,以及在多线程环境下的安全处理等细节进行了研究,保证了在多线程环境下能够快速同时采用一种基于数组的链表机制,改进内存池中内存块的查找算法,将其时间复杂度稳定在O(1),避免了传统内存池中请求的线程数目过多时,引发的获取内存块性能下降的问题。同时在内部设置管理线程,动态增加或删除空闲的内存块。实验结果表明,改进后的内存池与传统的内存分配方式相比消耗更小,效率更好。

关 键 词:内存池  内存块查找算法  Linux  多线程

Design and implement of memory pool under multi-thread of Linux
Xu Jian , Yu Hongyang.Design and implement of memory pool under multi-thread of Linux[J].Application of Electronic Technique,2012,38(11):146-149.
Authors:Xu Jian  Yu Hongyang
Affiliation:(Research Institute of Electronic Science and Technology,University of Electronic Science and Technology,Chengdu 611731,China)
Abstract:After much research on the allocate and gain mechanism,dynamic adjustment,safety use,free method,the basic size of the memory block ensure it's can work well in mutli-mem enviorment.Meanwhile,using a mechanism of array-based linked list to improve the searching and allocation algorithm in the memory pool,making the time complexity stable at O(1),and avoid the degradation of allocation and query performance when aquired memory mem number is too large in the traditional mem pool.Experimental results show that the improved memory pool has a smaller cost and better efficiency compared with the traditional memory distribution.
Keywords:memory pool  memroy block find method  Linux  multi-thread
本文献已被 CNKI 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号