计算机科学 ›› 2013, Vol. 40 ›› Issue (9): 35-37.

• 综述 • 上一篇    下一篇

基于硬件锁的多线程同步设计和实现

李春江,唐滔,杨灿群   

  1. 国防科学技术大学计算机学院 长沙410073;国防科学技术大学计算机学院 长沙410073;国防科学技术大学计算机学院 长沙410073
  • 出版日期:2018-11-16 发布日期:2018-11-16
  • 基金资助:
    本文受国家自然科学基金项目(61170046,61170045),国家863计划项目(2012AA010903)资助

Design and Implementation of Synchronization for Multithreading Based on Hardware Locks

LI Chun-jiang,TANG Tao and YANG Can-qun   

  • Online:2018-11-16 Published:2018-11-16

摘要: 硬件锁用简单的取数指令实现“取并加一”或“取并减一”的原子操作。首先介绍了通用多核多线程FT处理器实现的硬件锁机制,并和软件锁机制进行了比较,之后介绍了使用硬件锁机制实现多线程同步的方法,然后在GNU OpenMP运行库中设计并实现了利用硬件锁的多线程同步机制,最后采用典型OpenMP测试程序对使用硬件锁和使用软件锁的同步操作性能进行了评估和分析。

关键词: 硬件锁,同步,FT处理器,GNU OpenMP运行库 中图法分类号TP314 文献标识码A

Abstract: Hardware locks provide the atomic operation mechanism of "load and add one" or "load and subtract one" by simple load instructions.Firstly,we introduced the implementation of hardware locks in general purpose multi-core multi-threaded FT processors,and compared with the software lock mechanism,then described the method for synchronization of multi-threading using hardware locks.In the GNU OpenMP runtime library,we designed and implemented the synchronization mechanism based on hardware locks for FT processors.Finally,we evaluated the performance of typical OpenMP programs using hardware locks versus using software locks and gave some valuable analysis.

Key words: Hardware locks,Synchronization,FT processor,GNU OpenMP runtimes

[1] UltraSPARC Architecture 2007[S].Draft D0.9.1,01 Aug2007:423
[2] Intel 64 and IA-32 Architectures Software Developer’s Manual, Combined Volumes:1,2A,2B,3A and 3B [S].Intel Corporation,May 2011
[3] OpenMP Application Program Interface.Version 3.0[S]. OpenMP Group, May 2008.http://www.open mp.org/
[4] The GNU OpenMP Implementation .http:/gcc.gnu.org
[5] 李春江,杜云飞,易会战,等.GCC中内嵌函数实现剖析[J].计算机科学,2012(6A)
[6] NASA Parallel Benchmark 3.3.1.http://www.nas.nasa.gov/publications/npb.html
[7] Syncbench.http://trac.mcs.anl.gov/projects/perfor man-ce/browser/benchmarks/openmpbench-C-v2/syncbench.c?rev=666

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!