检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:郑雅洁[1] 张冬雯[1] 张杨[1] 郭松[1] 梁亚楠 魏萌萌 于欣
机构地区:[1]河北科技大学信息科学与工程学院,河北石家庄050018
出 处:《河北工业科技》2017年第6期414-420,共7页Hebei Journal of Industrial Science and Technology
基 金:国家自然科学基金(61440012);河北省研究生创新项目(XZZSS2017087)
摘 要:针对并行环境下出现的非线程安全问题,以哈希机制的Hashtable和ConcurrentHashMap的线程安全问题为切入点,设计了可改变线程总数和读写线程数的测试程序,分析了线程安全的ConcurrentHashMap和Hashtable的性能差异。根据性能差异,设计了从Hashtable到ConcurrentHashMap的程序自动重构插件,进而在Hashtable封装数据的情况下,通过对比传统多线程处理方式和Java8中的并行流处理方式的性能差异,分析了流处理方式相对普通多线程处理方式的高效性。对比结果显示,ConcurrentHashMap在并行程序中的性能要优于Hashtable。研究结果为多线程程序开发提出了解决非线程安全提供了较为可行的新思路,对于并行编程具有借鉴意义。Aiming at the non-thread-safe under parallel environment,taking Hashtable and ConcurrentHashMap of Hash Mechanism as study objects,the test programs with variable numbers of threads and read-write threads are designed.The performance difference between ConcurrentHashMap and Hashtable is analyzed through the test program.According to the performance difference,the automatic refactoring of the program from Hashtable to ConcurrentHashMap is completed.Then in condition of the Hashtable encapsulation data,the performance difference between traditional multithreaded program processing and Java8 parallel stream handling approach is compared to analyze the effectiveness of parallel stream handling approach.The comparison result shows that the performance of ConcurrentHashMap in the parallel program is better than that of Hashtable.The research result provides new ways for solving non-thread-safe problems,which can be reference for parallel programming.
关 键 词:程序设计及其语言 线程安全 ConcurrentHashMap 哈希机制 重构 并行 流处理 Java8
分 类 号:TP312[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:3.137.142.253