{"repo":"W4G1/multithreading","free":true,"listed":false,"github":"https://github.com/W4G1/multithreading","clone":"git clone https://github.com/W4G1/multithreading.git","description":"The missing standard library for multithreading in JavaScript (Works in the browser, Node.js, Deno, Bun)","language":"TypeScript","stars":1607,"topics":["multithreading","threads","webworkers","worker-threads","concurrency","javascript","multi-threading","nodejs","parallel-processing","typescript"],"license":"MIT","category":"dev-tools","readme_excerpt":"Multithreading.js Robust, Rust-inspired concurrency primitives for the JavaScript ecosystem. &color=rgb(13%2C%2017%2C%2023)) Multithreading is a TypeScript library that brings robust, Rust-inspired concurrency primitives to the JavaScript ecosystem. It provides a thread-pool architecture, strict memory safety semantics, and synchronization primitives like Mutexes, Semaphores, Read-Write Locks, and Condition Variables. This library is designed to abstract away the complexity of managing WebWorkers , serialization, and SharedArrayBuffer complexities, allowing developers to write multi-threaded code that looks and feels like standard asynchronous JavaScript. Installation See: Browser compatibility Core Concepts JavaScript is traditionally single-threaded. To achieve true parallelism, this library uses Web Workers. However, unlike standard Workers, this library offers: 1. Managed Worker Pool : Automatically manages a pool of threads based on hardware concurrency. 2. Shared Memory Primitives : Tools to safely share state between threads without race conditions. 3. Scoped Imports : Support for importing external modules and relative files directly within worker tasks. 4. Move Semantics : Explicit data ownership transfer to prevent cloning overhead. Quick Start The entry point for most operations is the spawn function. This submits a task to the thread pool and returns a handle to await the result. ----- Passing Data: The move() Function Because Web Workers run in a completely isola","default_branch":null,"files":null,"tree":[],"storefront":"/r/W4G1","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/W4G1/multithreading/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}