Current status: toying with Atomics and worker_threads.
This is what I got so far https://codeberg.org/indutny/flux/src/branch/main/lib/flux.mjs
The idea is to have a fast channel of notifying the main thread when a worker thread is available to pick up new work.
I suspect that this is faster than doing postMessage/message for a few reasons:
- It only uses atomics and not uv_async_send (that writes to an fd)
- It does not serialize any data
Now... I need to figure out a way to benchmark it!
