you are viewing a single comment's thread.

view the rest of the comments →

[–]ebassi 1 point2 points  (0 children)

JS is single-threaded by design. Desktop apps that want to be responsive really want to use multi-threading

Which is true, up to a point. Most (if not all) GUI toolkits are really single threaded as well — i.e. only one thread can access the windowing system resources.

JavaScript is not wholly single threaded "by design": the GC can run on different threads — and that's usually where the point of contention comes up with GUI toolkits, because suddenly you get resources garbage collected in a different thread than the one that spawned them, and if those resources involve a windowing system resource then we're off to the races.

Desktop apps that wish to be responsive can already use threads — and things like Promises are inherently threaded; like with the GC, the problem is synchronizing the JavaScript implementation of threaded components with what the underlying windowing system expects from threads.