Abstract
The cost of implementing FIFO queues and stacks is studied under two consistency condiions for shared memory multiprocessors, sequential consistency and linearizability. The cost measure is the worst-case response time in distributed implementations of virtual shared memory supporting one of the two conditions. The worst-case response time is very sensitive to the assumptions that are made about the timing information available to the system. All the results in this paper assume that processes have clocks that run at the same rate as real time and that all message delays are in the range [d−u, d] for some known constants u and d, 0≤u≤d.
If processes have perfectly synchronized clocks or if every message has delay exactly d, then the response time of a dequeue operation is at least d, for any sequentially consistent implementation of FIFO queues. This matches exactly an upper bound in which an enqueue operation is performed instantaneously and the response time of a dequeue operation is d; this upper bound implements linearizability. If clocks are not perfectly synchronized and if message delays are variable, i.e., u>0, then, for any linearizable implementation of a queue, the response time of an enqueue operations is at least Ω(u). In contrast, we present sequentially consistent implementation for this weaker timing model in which an enqueue operation is performed instantaneously, and the worst-case response time of a dequeue operation is 2d. (This algorithm is completely asynchronous and does not rely on any timing information.)
Similar results are proved for implementing stacks, with the pop operation playing the role of the dequeue operation, and the push operation playing the role of the enqueue operation.
A complete version of this paper appeared as Technical Report #672, Department of Computer Science, The Technion, Haifa, Israel, May 1991.
Preview
Unable to display preview. Download preview PDF.
References
S. Adve and M. Hill, “Implementing Sequential Consistency in Cache-Based Systems,” Proc. Int. Conf. on Parallel Processing, 1990.
Y. Afek, G. Brown, and M. Merritt. “A Lazy Cache Algorithm,” Proc. 1st ACM Symp. on Parallel Algorithms and Architectures, 1989, pp. 209–222.
H. Attiya and J. L. Welch, “Sequential Consistency versus Linearizability,” Proc. 3rd ACM Symp. on Parallel Algorithms and Architectures, 1991, pp. 305–315.
J. Bennett, J. Carter, and W. Zwaenepoel, “Munin: Distributed Shared Memory Based on Type-Specific Memory Coherence,” Proc. 2nd ACM Symp. on Principles and Practice of Parallel Programming, 1990, pp. 168–176.
R. Bisiani, A. Nowatzyk, and M. Ravishankar, “Coherent Shared Memory on a Distributed Memory Machine,” Proc. Int. Conf. on Parallel Processing, 1989, pp. I-133–141.
P. Bernstein, V. Hadzilacos, and H. Goodman, Concurrency Control and Recovery in Database Systems, Addison-Wesley, Reading, MA, 1987.
K. Birman and T. Joseph, “Reliable Communication in the Presence of Failures,” ACM Trans. on Computer Systems, Vol. 5, No. 1 (February 1987), pp. 47–76.
W. Brantley, K. McAuliffe, and J. Weiss, “RP3 Processor-Memory Element,” Proc. Int. Conf. on Parallel Processing, 1985, pp. 782–789.
M. Dubois and C. Scheurich, “Memory Access Dependencies in Shared-Memory Multiprocessors”, IEEE Trans. on Software Engineering, vol. 16, no. 6 (June 1990), pp. 660–673.
M. Herlihy, “Wait-Free Implementations of Concurrent Objects,” Proc. 7th ACM Symp. on Principles of Distributed Computing, 1988, pp. 276–290.
M. Herlihy and J. Wing, “Linearizability: A Correctness Condition for Concurrent Objects,” ACM Trans, on Programming Languages and Systems, Vol. 12, No. 3 (July 1990), pp. 463–492.
L. Lamport, “How to Make a Multiprocessor Computer that Correctly Executes Multiprocess Programs,” IEEE Trans. on Computers, Vol. C-28, No. 9 (September 1979), pp. 690–691.
K. Li and P. Hudak, “Memory Coherence in Shared Virtual Memory Systems,” ACM Trans. on Computer Systems, vol. 7, no. 4, pp. 321–359.
R. Lipton and J. Sandberg, PRAM: A Scalable Shared Memory, Technical Report CS-TR-180-88, Princeton University, September 1988.
J. Lundelius and N. Lynch, “An Upper and Lower Bound for Clock Synchronization,” Information and Control, Vol. 62, Nos. 2/3 (August/September 1984), pp. 190–204.
S. Min and J. Baer, “A Timestamp-Based Cache Coherence Scheme,” Proc. Int. Conf. on Parallel Processing, 1989, pp. I–23–32.
C. Papadimitriou, The Theory of Concurrency Control, Computer Science Press, Rockville, MD, 1986.
U. Ramachandran, M. Ahamad, and M. Y. Khalidi, “Coherence of Distributed Shared Memory: Unifying Synchronization and Data Transfer,” Proc. Int. Conf. on Parallel Processing, 1989, pp. II–160–169.
C. Scheurich and M. Dubois, “Correct Memory Operation of Cache-Based Multiprocessors,” Proc. 14th Int. Symp. on Computer Architecture, 1987, pp. 234–243.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Attiya, H. (1992). Implementing FIFO queues and stacks. In: Toueg, S., Spirakis, P.G., Kirousis, L. (eds) Distributed Algorithms. WDAG 1991. Lecture Notes in Computer Science, vol 579. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0022439
Download citation
DOI: https://doi.org/10.1007/BFb0022439
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55236-9
Online ISBN: 978-3-540-46789-2
eBook Packages: Springer Book Archive