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

Linux下通用线程池的改进与实现
引用本文:唐富强,于鸿洋,张萍. Linux下通用线程池的改进与实现[J]. 计算机工程与应用, 2012, 48(28): 77-83
作者姓名:唐富强  于鸿洋  张萍
作者单位:1.电子科技大学 电子科学技术研究院,成都 6117312.电子科技大学 电子工程学院,成都 611731
摘    要:对线程池的阻塞唤醒机制,动态调整,线程安全退出,参数处理,系统线程数限制等细节进行研究,保证了其在不同应用场景下的独立性和通用性;同时采用一种基于数组的链表机制来改进线程池的查找分配算法,将其时间复杂度稳定在O(1),避免了传统线程池当线程数目过大时导致的查询分配性能下降的问题。实验结果表明,改进后的线程池与传统的系统线程分配方式相比在开销上有很大节省。

关 键 词:线程池  线程退出  线程查找分配  linux  阻塞唤醒  

Improvement and implementation of general thread pool under Linux
TANG Fuqiang , YU Hongyang , ZHANG Ping. Improvement and implementation of general thread pool under Linux[J]. Computer Engineering and Applications, 2012, 48(28): 77-83
Authors:TANG Fuqiang    YU Hongyang    ZHANG Ping
Affiliation:1.Research Institute of Electronic Science and Technology, University of Electronic Science and Technology of China, Chengdu 611731, China2.School of Electronic Engineering, University of Electronic Science and Technology of China, Chengdu 611731, China
Abstract:Do research on blocking and wakeup mechanism,dynamic adjustment,thread exit safely,parameter processing,the system maximam number of threads limits and other details in thread pool,to ensure its independence and generality under the different scenarios;meanwhile,using a linked list of array-based mechanisms to improve the search and allocation algorithm in thread pool,to be stable in time complexity O(1),and avoid the problem that allocate and query performance will degrade in the traditional thread pool when the number of threads allocated is too large,experimental results show that there is a great saving in cost with the traditional distribution system compared to the thread.
Keywords:threadpool  thread exit  thread find and assign  linux  blocking and wakeup
本文献已被 CNKI 维普 万方数据 等数据库收录!
点击此处可从《计算机工程与应用》浏览原始摘要信息
点击此处可从《计算机工程与应用》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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