Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev...
by gorjusborg on Wednesday May 04, 2022 @02:55PM
(#31264417)
What I mean is: async/await is just syntactic sugar over promises/futures and those just buy you a way to schedule future computation. The js runtimes schedule all your code on a single thread. It's the fact your code only runs on a single thread that 'solves concurrency' because data races can't happen if one thread of code is allowed to access memory at a time.
You can set up the same limitation in a threaded program/language, and people have (see vert.x, clojure STM, and others).
You can set up the same limitation in a threaded program/language, and people have (see vert.x, clojure STM, and others).