skip to main content
research-article

GEMs: shared-memory parallel programming for Node.js

Published:19 October 2016Publication History
Skip Abstract Section

Abstract

JavaScript is the most popular programming language for client-side Web applications, and Node.js has popularized the language for server-side computing, too. In this domain, the minimal support for parallel programming remains however a major limitation. In this paper we introduce a novel parallel programming abstraction called Generic Messages (GEMs). GEMs allow one to combine message passing and shared-memory parallelism, extending the classes of parallel applications that can be built with Node.js. GEMs have customizable semantics and enable several forms of thread safety, isolation, and concurrency control. GEMs are designed as convenient JavaScript abstractions that expose high-level and safe parallelism models to the developer. Experiments show that GEMs outperform equivalent Node.js applications thanks to their usage of shared memory.

References

  1. MemCached Object Caching System.Google ScholarGoogle Scholar
  2. Redis Data Structure Store.Google ScholarGoogle Scholar
  3. The Google V8 JavaScript engine.Google ScholarGoogle Scholar
  4. HTML5 WebWorker API.Google ScholarGoogle Scholar
  5. Lambda: Microservices in the Cloud.Google ScholarGoogle Scholar
  6. ECMAScript Language Specification. v6.Google ScholarGoogle Scholar
  7. The JavaScript Object Notation (JSON) Data Interchange Format.Google ScholarGoogle Scholar
  8. Node.JS Cluster module,.Google ScholarGoogle Scholar
  9. Node.JS TTL-cache: Simple in-memory object cache with TTL based per-item expiry,.Google ScholarGoogle Scholar
  10. SharedArrayBuffer Specification Draft.Google ScholarGoogle Scholar
  11. G. Agha. Actors: a model of concurrent computation in distributed systems. MIT Press, Cambridge, MA, USA, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Boyapati, R. Lee, and M. Rinard. Ownership types for safe programming: Preventing data races and deadlocks. In Proc. of OOPSLA ’02, pages 211–230, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. Boyland, J. Noble, and W. Retert. Capabilities for sharing: A generalisation of uniqueness and read-only. In Proc. of ECOOP ’01, pages 2–27, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Y. Cheng, A. Gupta, and A. R. Butt. An in-memory object caching framework with adaptive load balancing. In Proc. of EuroSys ’15, pages 4:1–4:16, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Clebsch, S. Drossopoulou, S. Blessing, and A. McNeil. Deny capabilities for safe, fast actors. In Proc. of AGERE! ’15, pages 1–12, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Cole. Algorithmic skeletons: structured management of parallel computation. MIT Press, Cambridge, MA, USA, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. R. Cutting, D. R. Karger, J. O. Pedersen, and J. W. Tukey. Scatter/gather: A cluster-based approach to browsing large document collections. In Proc. of SIGIR ’92, pages 318–329, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. De Koster, S. Marr, T. D’Hondt, and T. Van Cutsem. Domains: safe sharing among actors. Science of Computer Programming, 98, Part 2:140–158, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. De Wael, S. Marr, B. De Fraine, T. Van Cutsem, and W. De Meuter. Partitioned Global Address Space Languages. ACM Computing Surveys, 47:62:1–62:27, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. Dean and S. Ghemawat. Mapreduce: simplified data processing on large clusters. Communications of the ACM, 51 (1):107–113, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. B. Dennis and E. C. Van Horn. Programming Semantics for Multiprogrammed Computations. Commun. ACM, 9(3): 143–155, Mar. 1966. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. D. Dice and N. Shavit. TLRW: Return of the read-write lock. In Proc. of SPAA ’10, pages 284–293, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Dodds, X. Feng, M. Parkinson, and V. Vafeiadis. Denyguarantee reasoning. In Proc. of ESOP ’09, pages 363–377, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. S. J. Frank. Tightly coupled multiprocessor system speeds memory-access times. Electronics;(United States), 1, 1984.Google ScholarGoogle Scholar
  25. A. Friedley, T. Hoefler, G. Bronevetsky, A. Lumsdaine, and C.-C. Ma. Ownership passing: Efficient distributed memory programming on multi-core systems. In Proc. of PPoPP ’13, pages 177–186. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Frigo, P. Halpern, C. E. Leiserson, and S. Lewin-Berlin. Reducers and other cilk++ hyperobjects. In Proceedings of the Twenty-first Annual Symposium on Parallelism in Algorithms and Architectures, SPAA ’09, pages 79–90. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. T. Harris, J. Larus, and R. Rajwar. Transactional Memory. Morgan and Claypool, 2nd edition, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. S. Herhut, R. L. Hudson, T. Shpeisman, and J. Sreeram. Parallel programming for the Web. In Proc. of USENIX HotPar ’12, pages 1–6, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. U. Hölzle, C. Chambers, and D. Ungar. Optimizing Dynamically-typed Object-oriented Languages with Polymorphic Inline Caches. In Proc. of ECOOP ’91, pages 21–38, London, UK, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. S. M. Imam and V. Sarkar. Savina - An Actor Benchmark Suite: Enabling Empirical Evaluation of Actor Libraries. In Proc. of AGERE ’14, pages 67–80. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. T. Kalibera and R. Jones. Rigorous benchmarking in reasonable time. In Proc. of ISMM ’13, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. R. K. Karmani, A. Shali, and G. Agha. Actor Frameworks for the JVM Platform: A Comparative Analysis. In Proc. of PPPJ ’09, pages 11–20. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. G. Kiczales, J. des Rivires, and D. G. Bobrow. The Art of the Metaobject Protocol. The MIT Press, Cambridge, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. L.-Q. Lee and A. Lumsdaine. Generic programming for high performance scientific applications. In Proc. of JCI ’02, pages 112–121, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. L.-Q. Lee and A. Lumsdaine. The generic message passing framework. In Proc.of IPDPS ’03, pages 10 pp.–, April 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. B. P. Lester. The Art of Parallel Programming. Prentice-Hall, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. R. Lublinerman, J. Zhao, Z. Budimli´c, S. Chaudhuri, and V. Sarkar. SIGPLAN Not., 46(10):885–902, Oct. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. J. Manson, W. Pugh, and S. V. Adve. The Java Memory Model. In Proc. of PLDI ’05, pages 378–391, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. N. D. Matsakis. Parallel closures: a new twist on an old idea. In Proc. of HotPar ’12, pages 1–6, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. M. Miller, K.-P. Yee, and J. Shapiro. Capability myths demolished. Technical report, Johns Hopkins University Systems Research Laboratory, 2003.Google ScholarGoogle Scholar
  41. S. Negara, R. K. Karmani, and G. Agha. Inferring ownership transfer for efficient message passing. In Proc. of PPoPP ’11, pages 81–90. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. K. Palacz, J. Vitek, G. Czajkowski, and L. Daynas. Incommunicado: Efficient communication for isolates. In Proc. of OOPSLA ’02, pages 262–274, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. J. Protic, M. Tomasevic, and V. Milutinovi´c. Distributed shared memory: Concepts and systems, volume 21. John Wiley & Sons, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. J. E. Richardson, M. J. Carey, and D. T. Schuh. The design of the e programming language. ACM Trans. Program. Lang. Syst., 15(3):494–534, July 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. J. Shun. Shared-Memory Parallelism Can Be Simple, Fast, and Scalable. PhD thesis, 2015.Google ScholarGoogle Scholar
  46. S. Tilkov and S. Vinoski. Node.js: Using JavaScript to build high-performance network programs. IEEE Internet Computing, 14:80–83, November 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. T. Van Cutsem and M. S. Miller. Proxies: Design Principles for Robust Object-oriented Intercession APIs. In Proc. of DLS ’10, pages 59–72, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. N. Viennot, M. Lécuyer, J. Bell, R. Geambasu, and J. Nieh. Synapse: A microservices architecture for heterogeneousdatabase web applications. In Proc. of EuroSys ’15, pages 21:1–21:16, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. C. Wimmer and T. Würthinger. Truffle: a self-optimizing runtime system. In Proc. of SPLASH ’12, pages 13–14, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. M. Zaharia, M. Chowdhury, T. Das, A. Dave, J. Ma, M. Mc-Cauley, M. J. Franklin, S. Shenker, and I. Stoica. Resilient distributed datasets: A fault-tolerant abstraction for in-memory cluster computing. In Proc. of NSDI ’12, pages 2–2, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. GEMs: shared-memory parallel programming for Node.js

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 51, Issue 10
        OOPSLA '16
        October 2016
        915 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/3022671
        Issue’s Table of Contents
        • cover image ACM Conferences
          OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
          October 2016
          915 pages
          ISBN:9781450344449
          DOI:10.1145/2983990

        Copyright © 2016 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 19 October 2016

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!