logoalt Hacker News

curtisblaineyesterday at 9:48 PM1 replyview on HN

To all the people saying "it's dangerous to add concurrency to javascript", javascript has already workers, shared array buffers and atomics. It's entirely possible today to start two or more workers, pass a shared array buffer via a message and then write concurrently on the same buffer forfeiting message passing and synchronizing only using atomics. You can even do lock less data structures, see for example https://greenvitriol.com/posts/lockless-allocator. That's what you do when you write high performance Web apps. This proposal only adds lightweight threads sharing memory by default, but it's by no means the first and only way to do low level concurrency with javascript.


Replies

kikimoratoday at 1:27 AM

This is from PR: v1 collects synchronous and stop-the-world

Go build performant web app that has stop-the-world all the time.

show 1 reply