Re:15 Years of Concurrency
by danarmak on Thursday December 01, 2016 @10:47AM
(#13080148)
The bigger problem is that Javascript disallows (or at least, browsers don't currently provide) efficient sharing of immutable values between threads/workers.
Because JS has no notion of immutability, sharing is done via copying - but what's worse, copying via full-blown serialization, not just in-memory blitting or COW. At least, that was the state of things when I last checked a year ago.
Re:15 Years of Concurrency
by maxpolun on Thursday December 01, 2016 @12:57PM
(#13081657)
Modern JS does allow you to send large buffers from one worker to another with just a pointer copy (because it stops being accessible from the sender).
Re:15 Years of Concurrency
by danarmak on Friday December 02, 2016 @05:52AM
(#13087627)
Yes, but even with that restriction, it doesn't let you transfer ownership of structured messages, only buffers and images; so a serialization roundtrip is needed.
Because JS has no notion of immutability, sharing is done via copying - but what's worse, copying via full-blown serialization, not just in-memory blitting or COW. At least, that was the state of things when I last checked a year ago.