Название: Multithreaded jаvascript: Concurrency Beyond the Event Loop (Final) Автор: Thomas Hunter II, Bryan English Издательство: O’Reilly Media, Inc. Год: 2022 Страниц: 214 Язык: английский Формат: pdf (true), epub Размер: 10.2 MB, 10.2 MB
The nature of jаvascript is to be single threaded. This is reflected not only in libraries and applications, but also in online forum posts, books, and online documentation. Thanks to recent advancements in the platform—such as with web workers in the browser, worker_threads in Node.js, and the Atomics and SharedArrayBuffer objects - jаvascript engineers are able to build multi-threaded applications. These features will go down as being the biggest paradigm shift for the world's most popular programming language.
Multithreaded jаvascript explores the various features that jаvascript runtimes have at their disposal for implementing multithreaded programming, using a spectrum of API reference material and high level programming patterns.
In this book, Bryan and Thomas expertly lay out the foundations of multithreaded development in general, and deftly illustrate how the various jаvascript runtimes like web browsers and Node.js enable parallel computing with a programming language that includes no built-in mechanisms to enable it. Because the responsibility for providing multithreading support has fallen on the runtimes, and because there are so many differences between those runtimes, browsers and platforms like Node.js implement multithreading in different ways. Although they share similar APIs, a worker thread in Node.js is really not the same thing as a web worker in a web browser. Support for shared workers, web workers, and service workers is nearly universal across browsers, and worker threads have been in Node.js for several years now, but they are all still a relatively new concept for jаvascript developers. No matter where your jаvascript runs, this book will provide important insight and information. Most importantly, however, the authors take the time to explain exactly why you should care at all about multithreading in your jаvascript applications.
Learn what multithreaded programming is and how you can benefit from it Understand the differences between a dedicated worker, a shared worker, and a service worker Identify when and when not to use threads in an application Orchestrate communication between threads by leveraging the Atomics object Understand both the gains and pitfalls of using shared memory Benchmark performance to learn when you'll benefit from multiple threads
Target Audience: The ideal reader of this book is an engineer who has been writing jаvascript for a few years, and who doesn’t necessarily have experience with writing multithreaded applications or even experience with more traditionally multithreaded languages like C++ or Java. We do include some example C application code, as a sort of multithreaded lingua franca, but it’s not something that the reader is expected to be familiar with or even understand. If you do have experience with such languages, that’s great, and this book will help you understand the jаvascript equivalent to the functionality provided by whatever language you may be familiar with. On the other hand, if you’ve only written code using jаvascript, then this book is also for you. We include information across multiple layers of learning; this includes both low-level API references, high-level patterns, and plenty of technical tangents in between to help fill in any gaps.
Скачать Multithreaded jаvascript: Concurrency Beyond the Event Loop (Final)
Внимание
Уважаемый посетитель, Вы зашли на сайт как незарегистрированный пользователь.
Мы рекомендуем Вам зарегистрироваться либо войти на сайт под своим именем.
Информация
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.