Building Counting Networks from Larger Balancers Technical Report # 93-04-09

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.