Skip to main content

Implementing FIFO queues and stacks

Extended abstract

  • Conference paper
  • First Online:
Book cover Distributed Algorithms (WDAG 1991)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 579))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. S. Adve and M. Hill, “Implementing Sequential Consistency in Cache-Based Systems,” Proc. Int. Conf. on Parallel Processing, 1990.

    Google Scholar 

  2. Y. Afek, G. Brown, and M. Merritt. “A Lazy Cache Algorithm,” Proc. 1st ACM Symp. on Parallel Algorithms and Architectures, 1989, pp. 209–222.

    Google Scholar 

  3. H. Attiya and J. L. Welch, “Sequential Consistency versus Linearizability,” Proc. 3rd ACM Symp. on Parallel Algorithms and Architectures, 1991, pp. 305–315.

    Google Scholar 

  4. 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.

    Google Scholar 

  5. 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.

    Google Scholar 

  6. P. Bernstein, V. Hadzilacos, and H. Goodman, Concurrency Control and Recovery in Database Systems, Addison-Wesley, Reading, MA, 1987.

    Google Scholar 

  7. 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.

    Google Scholar 

  8. W. Brantley, K. McAuliffe, and J. Weiss, “RP3 Processor-Memory Element,” Proc. Int. Conf. on Parallel Processing, 1985, pp. 782–789.

    Google Scholar 

  9. 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.

    Google Scholar 

  10. M. Herlihy, “Wait-Free Implementations of Concurrent Objects,” Proc. 7th ACM Symp. on Principles of Distributed Computing, 1988, pp. 276–290.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. 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.

    Google Scholar 

  13. K. Li and P. Hudak, “Memory Coherence in Shared Virtual Memory Systems,” ACM Trans. on Computer Systems, vol. 7, no. 4, pp. 321–359.

    Google Scholar 

  14. R. Lipton and J. Sandberg, PRAM: A Scalable Shared Memory, Technical Report CS-TR-180-88, Princeton University, September 1988.

    Google Scholar 

  15. 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.

    Google Scholar 

  16. S. Min and J. Baer, “A Timestamp-Based Cache Coherence Scheme,” Proc. Int. Conf. on Parallel Processing, 1989, pp. I–23–32.

    Google Scholar 

  17. C. Papadimitriou, The Theory of Concurrency Control, Computer Science Press, Rockville, MD, 1986.

    Google Scholar 

  18. 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.

    Google Scholar 

  19. C. Scheurich and M. Dubois, “Correct Memory Operation of Cache-Based Multiprocessors,” Proc. 14th Int. Symp. on Computer Architecture, 1987, pp. 234–243.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Sam Toueg Paul G. Spirakis Lefteris Kirousis

Rights and permissions

Reprints 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

Publish with us

Policies and ethics