Skip to main content

2017 | OriginalPaper | Buchkapitel

Simpler Coordination of JavaScript Web Workers

verfasst von : Marco Krauweel, Sung-Shik T. Q. Jongmans

Erschienen in: Coordination Models and Languages

Verlag: Springer International Publishing

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

JavaScript is a popular sequential language for implementing Web applications. To enable concurrent execution of JavaScript code, modern JavaScript engines support the Web Workers API. Using this API, developers can spawn concurrent background workers from a distinguished main worker. These workers, which run on the same machine (e.g., to exploit multicore), interact via message-passing.
The Web Workers API is relatively low-level, which makes implementing coordination protocols among background workers laborious and error-prone. To simplify this, we propose to hide the Web Workers API behind a coordination language that provides higher-level constructs. Importantly, developers already use JavaScript together with domain-specific languages HTML (for markup/structure) and CSS (for style/design); another domain-specific language (for coordination) seamlessly fits this practice. Using the coordination language Reo, we demonstrate the advantages and feasibility of this approach by example. We also present the necessary tool support (compiler; runtime library and API; front-end).

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Fußnoten
1
This is an inefficient implementation, but we aim for simplicity here.
 
2
This node is, in fact, syntactic sugar for a complexer circuit (i.e., it can be composed).
 
3
Compared to Figs. 14(a) and (b), the actual implementation also supports multiple ports per workers, and it is protected against workers that perform the next get (or put) before the previous one is completed. Details appear elsewhere [20].
 
4
Ideally, coordination overhead is completely independent of workload. In practice, however, this is not always so. The memory footprint of a workload can, for instance, affect the size of coordination overhead [16]. Generally, the larger a workload, the smaller the ratio \(\frac{\text {coordination}}{\text {computation}}\), the less impact coordination overhead has on performance, and the less important minimizing such overhead becomes; at that point, other software qualities (changeability, reusability, etc.) may take precedence.
 
Literatur
10.
Zurück zum Zitat Arbab, F.: Reo: a channel-based coordination model for component composition. Math. Struct. Comp. Sci. 14(3), 329–366 (2004)MathSciNetCrossRefMATH Arbab, F.: Reo: a channel-based coordination model for component composition. Math. Struct. Comp. Sci. 14(3), 329–366 (2004)MathSciNetCrossRefMATH
11.
Zurück zum Zitat Arbab, F.: Puff, the magic protocol. In: Agha, G., Danvy, O., Meseguer, J. (eds.) Formal Modeling: Actors, Open Systems, Biological Systems. LNCS, vol. 7000, pp. 169–206. Springer, Heidelberg (2011). doi:10.1007/978-3-642-24933-4_9 CrossRef Arbab, F.: Puff, the magic protocol. In: Agha, G., Danvy, O., Meseguer, J. (eds.) Formal Modeling: Actors, Open Systems, Biological Systems. LNCS, vol. 7000, pp. 169–206. Springer, Heidelberg (2011). doi:10.​1007/​978-3-642-24933-4_​9 CrossRef
12.
Zurück zum Zitat Baier, C., Sirjani, M., Arbab, F., Rutten, J.: Modeling component connectors in Reo by constraint automata. Sci. Comput. Program. 61(2), 75–113 (2006)MathSciNetCrossRefMATH Baier, C., Sirjani, M., Arbab, F., Rutten, J.: Modeling component connectors in Reo by constraint automata. Sci. Comput. Program. 61(2), 75–113 (2006)MathSciNetCrossRefMATH
13.
Zurück zum Zitat De Koster, J., Van Cutsem, T., De Meuter, W.: 43 years of actors: a taxonomy of actor models and their key properties. In: Proceedings of AGERE 2016, pp. 31–40. ACM (2016) De Koster, J., Van Cutsem, T., De Meuter, W.: 43 years of actors: a taxonomy of actor models and their key properties. In: Proceedings of AGERE 2016, pp. 31–40. ACM (2016)
14.
Zurück zum Zitat Herhut, S., Hudson, R., Shpeisman, T., Sreeram, J.: River trail: a path to parallelism in JavaScript. In: Proceedings of OOPSLA 2013, pp. 729–744. ACM (2013) Herhut, S., Hudson, R., Shpeisman, T., Sreeram, J.: River trail: a path to parallelism in JavaScript. In: Proceedings of OOPSLA 2013, pp. 729–744. ACM (2013)
15.
Zurück zum Zitat Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. ACM SIGPLAN Notices 43(1), 273–284 (2008). (Proceedings of POPL 2008)CrossRefMATH Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. ACM SIGPLAN Notices 43(1), 273–284 (2008). (Proceedings of POPL 2008)CrossRefMATH
16.
Zurück zum Zitat Jongmans, S.-S.T.Q.: Automata-theoretic protocol programming. Ph.D. thesis, Leiden University (2016) Jongmans, S.-S.T.Q.: Automata-theoretic protocol programming. Ph.D. thesis, Leiden University (2016)
17.
18.
Zurück zum Zitat Jongmans, S.-S.T.Q., Arbab, F.: Overview of thirty semantic formalisms for Reo. Sci. Ann. Comput. Sci. 22(1), 201–251 (2012)MathSciNet Jongmans, S.-S.T.Q., Arbab, F.: Overview of thirty semantic formalisms for Reo. Sci. Ann. Comput. Sci. 22(1), 201–251 (2012)MathSciNet
19.
Zurück zum Zitat Jongmans, S.-S.T.Q., Arbab, F.: Can high throughput atone for high latency in compiler-generated protocol code? In: Dastani, M., Sirjani, M. (eds.) FSEN 2015. LNCS, vol. 9392, pp. 238–258. Springer, Cham (2015). doi:10.1007/978-3-319-24644-4_17 CrossRef Jongmans, S.-S.T.Q., Arbab, F.: Can high throughput atone for high latency in compiler-generated protocol code? In: Dastani, M., Sirjani, M. (eds.) FSEN 2015. LNCS, vol. 9392, pp. 238–258. Springer, Cham (2015). doi:10.​1007/​978-3-319-24644-4_​17 CrossRef
20.
Zurück zum Zitat Krauweel, M.: Concurrent and asynchronous JavaScript programming using Reo. Master’s thesis, Open University of the Netherlands (2017) Krauweel, M.: Concurrent and asynchronous JavaScript programming using Reo. Master’s thesis, Open University of the Netherlands (2017)
21.
Zurück zum Zitat Myter, F., Scholliers, C., De Meuter, W.: Many spiders make a better web: a unified web-based actor framework. In: Proceedings of AGERE 2016, pp. 51–60. ACM (2016) Myter, F., Scholliers, C., De Meuter, W.: Many spiders make a better web: a unified web-based actor framework. In: Proceedings of AGERE 2016, pp. 51–60. ACM (2016)
22.
Zurück zum Zitat Ng, N., Yoshida, N.: Pabble: parameterised Scribble. Service Oriented Comput. Appl. 9(3-4), 269–284 (2015) Ng, N., Yoshida, N.: Pabble: parameterised Scribble. Service Oriented Comput. Appl. 9(3-4), 269–284 (2015)
23.
Zurück zum Zitat Parnas, D.: On the criteria to be used in decomposing systems into modules. Commun. ACM 15(12), 1053–1058 (1972)CrossRef Parnas, D.: On the criteria to be used in decomposing systems into modules. Commun. ACM 15(12), 1053–1058 (1972)CrossRef
24.
Zurück zum Zitat Philips, L., De Koster, J., De Meuter, W., De Roover, C.: Dependence-driven delimited CPS transformation for JavaScript. In: Proceedings of GPCE 2016, pp. 59–69. ACM (2016) Philips, L., De Koster, J., De Meuter, W., De Roover, C.: Dependence-driven delimited CPS transformation for JavaScript. In: Proceedings of GPCE 2016, pp. 59–69. ACM (2016)
25.
Zurück zum Zitat Radoi, C., Herhut, S., Sreeram, J., Dig, D.: Are web applications ready for parallelism? In: Proceedings of PPoPP 2015. ACM (2015) Radoi, C., Herhut, S., Sreeram, J., Dig, D.: Are web applications ready for parallelism? In: Proceedings of PPoPP 2015. ACM (2015)
26.
Zurück zum Zitat Stivan, G., Peruffo, A., Haller, P.: Akka. js: towards a portable actor runtime environment. In: Proceedings of AGERE! 2015, pp. 57–64. ACM (2015) Stivan, G., Peruffo, A., Haller, P.: Akka. js: towards a portable actor runtime environment. In: Proceedings of AGERE! 2015, pp. 57–64. ACM (2015)
27.
Zurück zum Zitat Welc, A., Hudson, R., Shpeisman, T., Adl-Tabatabai, A.R.: Generic workers: towards unified distributed and parallel Javascript programming model. In: Proceedings of PSI EtA 2010. ACM (2010) Welc, A., Hudson, R., Shpeisman, T., Adl-Tabatabai, A.R.: Generic workers: towards unified distributed and parallel Javascript programming model. In: Proceedings of PSI EtA 2010. ACM (2010)
28.
Zurück zum Zitat Zakas, N.: Promises and Asynchronous Programming. In: Understanding ECMAScript 6, Chap. 11, 1st edn., pp. 213–241. No Starch Press (2016) Zakas, N.: Promises and Asynchronous Programming. In: Understanding ECMAScript 6, Chap. 11, 1st edn., pp. 213–241. No Starch Press (2016)
Metadaten
Titel
Simpler Coordination of JavaScript Web Workers
verfasst von
Marco Krauweel
Sung-Shik T. Q. Jongmans
Copyright-Jahr
2017
DOI
https://doi.org/10.1007/978-3-319-59746-1_3

Premium Partner