2 ms·
Yes. Presumably transferrable objects would have to be created on a shared heap. Non-transferrables would live on thread-local heaps.
by spankalee 9y ago
Yes. Presumably transferrable objects would have to be created on a shared heap. Non-transferrables would live on thread-local heaps.
- pizlonator 9y agoI 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.
- amelius 9y agoYou don't need locks to access immutable objects (except perhaps for garbage collection). But I agree that transferring control is a bad idea.