2 ms·
> many webdevs just have no clue what a thread is, because generally, they don't need it, so it isn't taught JavaScript doesn't have threads.
by bsuvc 2y ago
> many webdevs just have no clue what a thread is, because generally, they don't need it, so it isn't taught
JavaScript doesn't have threads.
- Retr0id 2y agoThis is not meaningfully true in 2024
- Retr0id 2y ago*2025 (although still true of 2024 and several preceding years, heh)
- soulofmischief 2y agoParent commenter helped implement async in JS, they know what they are talking about. JS has threads locked behind semantics. Web workers run on separate threads. I do a lot of heavy parallel processing that never blocks the UI with them all the time.
- bsuvc 2y agoI stand corrected. It looks like web workers is the way for JavaScript to do multi-threading. Async has always been enough for what I need to do in the front end, as most of my long running processes are just calling a back end. Edit to add: for context, I am a full stack developer and know what threads are... I just never have needed them in the browser.
- soulofmischief 2y agoWeb workers are great for local compute and isolation. Unfortunately it's a hassle managing sane pooling because different platforms have different worker limits. On the other hand, the isolation guarantees are strong. There aren't really any footguns. Messaging is straightforward, works with a lot of data types and supports channels for inter-worker communication.