Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
W4G1 authored Dec 19, 2023
1 parent 9fb4ddd commit 4df856d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ With a minified size of only 4.5kb, it has first class support for [Node.js](htt

Depending on the environment, it uses [Worker Threads](https://nodejs.org/api/worker_threads.html) or [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Worker). In addition to [ES6 generators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) to make multithreading as simple as possible.

### The State of Multithreading in JavaScript

JavaScript's single-threaded nature means that tasks are executed one after the other, leading to potential performance bottlenecks and underutilized CPU resources. While Web Workers and Worker Threads offer a way to offload tasks to separate threads, managing the communication between these threads and their state is often complex and error-prone.

This project aims to solve these challenges by providing an intuitive Web Worker abstraction that mirrors the behavior of regular JavaScript functions.
This way it feels like you're executing a regular function, but in reality, it's running in parallel on a separate threads.

## Installation

```bash
Expand Down Expand Up @@ -141,4 +148,4 @@ const fn = threaded(function* () {

// ...
}
```
```

0 comments on commit 4df856d

Please sign in to comment.