ALGORITHMS FOR SCALABLE SYNCHRONIZATION ON SHARED-MEMORY MULTIPROCESSORS

被引:605
作者
MELLORCRUMMEY, JM [1 ]
SCOTT, ML [1 ]
机构
[1] UNIV ROCHESTER,DEPT COMP SCI,ROCHESTER,NY 14627
来源
ACM TRANSACTIONS ON COMPUTER SYSTEMS | 1991年 / 9卷 / 01期
关键词
D O I
10.1145/103727.103729
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Busy-wait techniques are heavily used for mutual exclusion and barrier synchronization in shared-memory parallel programs. Unfortunately, typical implementations of busy-waiting tend to produce large amounts of memory and interconnect contention, introducing performance bottlenecks that become markedly more pronounced as applications scale. We argue that this problem is not fundamental, and that one can in fact construct busy-wait synchronization algorithms that induce no memory or interconnect contention. The key to these algorithms is for every processor to spin on separate locally-accessible flag variables, and for some other processor to terminate the spin with a single remote write operation at an appropriate time. Flag variables may be locally-accessible as a result of coherent caching, or by virtue of allocation in the local portion of physically distributed shared memory. We present a new scalable algorithm for spin locks that generates 0(1) remote references per lock acquisition, independent of the number of processes attempting to acquire the lock. Our algorithm provides reasonable latency in the absence of contention, requires only a constant amount of space per lock, and requires no hardware support other than a swap-with-memory instruction. We also present a new scalable barrier algorithm that generates 0(1) remote references per processor reaching the barrier, and observe that two previously-known barriers can likewise be cast in a form that spins only on locally-accessible flag variables. None of these barrier algorithms requires hardware support beyond the usual atomicity of memory reads and writes. We compare the performance of our scalable algorithms with other software approaches to busy-wait synchronization on both a Sequent Symmetry and a BBN Butterfly. Our principal conclusion is that contention due to synchronization need not be a problem in large-scale shared-memory multiprocessors. The existence of scalable algorithms greatly weakens the case for costly special-purpose hardware support for synchronization, and provides a case against so-called "dance hall" architectures, in which shared memory locations are equally far from all processors.
引用
收藏
页码:21 / 65
页数:45
相关论文
共 52 条
[21]   THE MUTUAL EXCLUSION PROBLEM .1. A THEORY OF INTERPROCESS COMMUNICATION [J].
LAMPORT, L .
JOURNAL OF THE ACM, 1986, 33 (02) :313-326
[22]   NEW SOLUTION OF DIJKSTRAS CONCURRENT PROGRAMMING PROBLEM [J].
LAMPORT, L .
COMMUNICATIONS OF THE ACM, 1974, 17 (08) :453-455
[23]  
LEE C, 1990, 2 IEEE S PAR DIST PR, P130
[24]  
LEE J, 1990, MAY P INT S COMP ARC, P27
[25]  
LUBACHEVSKY B, 1989, 1989 P INT C PAR PRO, P175
[26]   AN APPROACH TO AUTOMATING THE VERIFICATION OF COMPACT PARALLEL COORDINATION PROGRAMS .1. [J].
LUBACHEVSKY, BD .
ACTA INFORMATICA, 1984, 21 (02) :125-169
[27]   A SQUARE-ROOT-N ALGORITHM FOR MUTUAL EXCLUSION IN DECENTRALIZED SYSTEMS [J].
MAEKAWA, M .
ACM TRANSACTIONS ON COMPUTER SYSTEMS, 1985, 3 (02) :145-159
[28]  
Mellor-Crummey J. M., 1987, 229 U ROCH COMP SCI
[29]  
MELLORCRUMMEY JM, 1990, 342 U ROCH COMP SCI
[30]  
MELLORCRUMMEY JM, 1990, COMPTR90114 RIC U DE