河北工业科技2017,Vol.34Issue(6):414-420,7.DOI:10.7535/hbgykj.2017yx06005
并行环境下Java哈希机制的对比及重构
Comparison and reconfiguration of Java hash mechanisms on parallel environment
摘要
Abstract
Aiming at the non-thread-safe under parallel environment,taking Hashtable and ConcurrentHashMap of Hash Mechanism as study obj ects,the test programs with variable numbers of threads and read-write threads are designed.The per-formance difference between ConcurrentHashMap and Hashtable is analyzed through the test program.According to the per-formance 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/哈希机制/重构/并行/流处理/Java8Key words
program design and its language/thread safety/ConcurrentHashMap/Hash mechanism/refactoring/parallel/stream handling/Java8分类
信息技术与安全科学引用本文复制引用
郑雅洁,张冬雯,张杨,郭松,梁亚楠,魏萌萌,于欣..并行环境下Java哈希机制的对比及重构[J].河北工业科技,2017,34(6):414-420,7.基金项目
国家自然科学基金(61440012) (61440012)
河北省研究生创新项目(XZZSS2017087) (XZZSS2017087)