Re:Concurrent JavaScript: It can work
by Jtsummers on Wednesday August 30, 2017 @01:59PM
(#15134409)
Shared memory could be hidden from the users. Passing objects would really be passing control of objects. If process A creates object a, and passes it to process B, no copying has to happen if the underlying mechanism uses shared memory and access control to effect the transfer (a change of owner).
[ Parent
| on HN ]
Re:Concurrent JavaScript: It can work
by spankalee on Wednesday August 30, 2017 @02:03PM
(#15134449)
Yes. Presumably transferrable objects would have to be created on a shared heap. Non-transferrables would live on thread-local heaps.
Re:Concurrent JavaScript: It can work
by pizlonator on Wednesday August 30, 2017 @02:45PM
(#15134796)
I find that thinking about multiple heaps is harder than thinking about threads. (Ever programmed with scoped memory? It's a nightmare.)
I find that thinking about transferrables is harder than thinking about threads. It's gross that an object suddenly loses all of its state just to give that object to another thread. Then, other parts of your code that still want access to that data have to do things that are definitely more gross than acquiring a lock.