- JavaScript Concurrency
- Adam Boduch
- 297字
- 2021-07-30 09:48:39
Chapter 2. The JavaScript Execution Model
The first chapter of this book explored the state of JavaScript concurrency. Generally speaking, dealing with concurrency in JavaScript applications is anything but a trivial matter. There's a lot to think about when writing concurrent JavaScript code, and the kind of solutions that we come up with are often unorthodox. There's a lot of callbacks, and wading through all of them is enough to drive a person insane. We also caught a glimpse of how our pattern of writing concurrent JavaScript code has started to change with existing concurrency components. Web workers have started to mature, and JavaScript language concurrency constructs have only just been introduced.
The language and the runtime environment only get us partway there. We need to think about concurrency at the design level, rather than after the fact. Concurrency should be the default. This is easy to say and very difficult to do. Throughout this book, we're going to explore all that the JavaScript concurrency features have to offer, and how we can best use them to our advantage as design tools. But, before we do this, we need to go into depth on what's really happening when our JavaScript runs. This knowledge is an essential input to designing concurrent applications, because we'll know exactly what to expect when choosing one concurrency mechanism over another.
In this chapter, we'll start with the browser environment, by looking at all the subsystems that our code touches—such as the JavaScript interpreter, the task queue, and the DOM itself. Then we'll walk through some code that will shed some light on what's really happening behind the scenes to orchestrate our code. We'll close the chapter with a discussion on the challenges that we face with this model.
- iOS 9 Game Development Essentials
- PyTorch自動(dòng)駕駛視覺(jué)感知算法實(shí)戰(zhàn)
- 精通搜索分析
- Cassandra Design Patterns(Second Edition)
- Animate CC二維動(dòng)畫(huà)設(shè)計(jì)與制作(微課版)
- Scala編程實(shí)戰(zhàn)(原書(shū)第2版)
- Swift細(xì)致入門(mén)與最佳實(shí)踐
- RISC-V體系結(jié)構(gòu)編程與實(shí)踐(第2版)
- 編程可以很簡(jiǎn)單
- .NET 4.5 Parallel Extensions Cookbook
- 零基礎(chǔ)學(xué)Python編程(少兒趣味版)
- 代碼閱讀
- JQuery風(fēng)暴:完美用戶(hù)體驗(yàn)
- 零基礎(chǔ)學(xué)C語(yǔ)言(第4版)
- Delphi開(kāi)發(fā)典型模塊大全(修訂版)