A Concurrency Model for JavaScript with Cooperative CancellationVirtual
Sun 17 Oct 2021 15:40 - 15:55 at Zurich C - GPCE/SLE Session 4 Chair(s): Eric Van Wyk
This paper proposes a concurrency model with thread abstractions and cooperative cancellation for JavaScript. JavaScript uses an event-driven model, where an active computation runs until it completes or blocks for an event while concurrent computations wait for events as callbacks. With the introduction of Promises, the control flow of callbacks can be written in a more direct style. However, the event-based model is still a source of confusion with regard to execution order, race conditions, and termination of computations.
Thread model is a familiar concept to programmers and can help reduce errors in developing JavaScript programs. This work is a library-based design, which uses an abstraction based on reader monad to pass a thread ID through a thread’s computation. A thread can be cancelled, paused, and resumed with its thread ID. This design allows hierarchical cancellation where a child thread is cancelled if its parent is cancelled. It also defines synchronization primitives to protect shared states. A formal semantics is included to give a precise definition of the proposed model.
Sun 17 OctDisplayed time zone: Central Time (US & Canada) change
07:40 - 09:00 | |||
07:40 15mTalk | A Concurrency Model for JavaScript with Cooperative CancellationVirtual SLE | ||
07:55 15mTalk | There Is More Than One Way to Zen Your PythonVirtual SLE | ||
08:10 15mTalk | Getting Grammars into Shape for Block-based EditorsVirtual SLE Mauricio Verano Merino Eindhoven University of Technology, Tom Beckmann Hasso Plattner Institute, Tijs van der Storm CWI; University of Groningen, Robert Hirschfeld Hasso Plattner Institute (HPI), University of Potsdam, Germany, Jurgen Vinju CWI; Eindhoven University of Technology Pre-print | ||
08:25 15mTalk | Extracting The Power of Dependent TypesVirtual GPCE | ||
08:40 20mLive Q&A | Discussion, Questions, Answers GPCE |
15:40 - 17:00 | |||
15:40 15mTalk | A Concurrency Model for JavaScript with Cooperative CancellationVirtual SLE | ||
15:55 15mTalk | There Is More Than One Way to Zen Your PythonVirtual SLE | ||
16:10 15mTalk | Getting Grammars into Shape for Block-based EditorsVirtual SLE Mauricio Verano Merino Eindhoven University of Technology, Tom Beckmann Hasso Plattner Institute, Tijs van der Storm CWI; University of Groningen, Robert Hirschfeld Hasso Plattner Institute (HPI), University of Potsdam, Germany, Jurgen Vinju CWI; Eindhoven University of Technology Pre-print | ||
16:25 15mTalk | Extracting The Power of Dependent TypesVirtual GPCE | ||
16:40 20mLive Q&A | Discussion, Questions, Answers GPCE |