We introduce a generalization of the counting networks of Aspnes, Herlihy, and Shavit [AHS91]. Our counting networks are constructed using k-balancers, rather than the 2-balancers of Aspnes et al. For reasonable values of k, k-balancers and 2-balancers can be implemented with equal e ciency on existing computers. Our k-bitonic networks have depths ranging from O(1) to O(log 2 w), where w is the number of inputs to the network. The depth of our networks varies with the choice of k; choosing the optimal k depends on a tradeo between the desire for a shallow network and the desire for low contention. We present the k-bitonic construction, prove its correctness, and introduce some useful variations to the construction. We then compare the performance of our networks with the networks of Aspnes et al., using simulation of idealized counting networks. Our networks perform at least as well in all cases, and typically have throughput about 25% higher than the networks of Aspnes et al.
[1]
Kenneth E. Batcher,et al.
Sorting networks and their applications
,
1968,
AFIPS Spring Joint Computing Conference.
[2]
E. Szemerédi,et al.
O(n LOG n) SORTING NETWORK.
,
1983
.
[3]
Thomas E. Anderson,et al.
The Performance of Spin Lock Alternatives for Shared-Memory Multiprocessors
,
1990,
IEEE Trans. Parallel Distributed Syst..
[4]
Michael L. Scott,et al.
Algorithms for scalable synchronization on shared-memory multiprocessors
,
1991,
TOCS.
[5]
Maurice Herlihy,et al.
Counting networks and multi-processor coordination
,
1991,
STOC '91.
[6]
Hagit Attiya,et al.
Counting networks with arbitrary fan-out
,
1992,
SODA '92.
[7]
C. Greg Plaxton,et al.
Small-depth counting networks
,
1992,
STOC '92.