On Tuesday, 13 May 2014 at 06:06:40 UTC, Rainer Schuetze wrote:
On 12.05.2014 13:53, "Marc Schütz" <[email protected]>" wrote:
I'm surprised that you didn't include:
3. Thread-local GC, isolated zones (restricting where
references to
objects of a particular heap can be placed), exempting certain
threads
from GC completely, ...
This comes up from time to time, but to me it is very blurry
how this can work in reality.
Considering how "shared" is supposed to be used to be useful
(do some locking, then cast away "shared") there is no
guarantee by the language that any object is actually thread
local (no references from other threads). Working with
immutable (e.g. strings) is shared by design.
Yes, but only a part of the data is shared. I suspect the
majority of the data in typical programs will be thread-local. If
you use a message passing model, you can improve that even
further (though it requires a way to move an object to another
thread's heap). This way, you can - in the best case - avoid the
shared heap completely.