Le 14/11/2012 02:39, Walter Bright a écrit :
On 11/13/2012 4:04 PM, deadalnix wrote:
That is what java's volatile do. It have several uses cases, including
valid
double check locking (It has to be noted that this idiom is used
incorrectly in
druntime ATM,

Please, please file a bug report about this, rather than a vague
statement here. If there already is one, please post its number.


http://d.puremagic.com/issues/show_bug.cgi?id=6607


So sequentially consistent read/write are usefull.

Sure, I agree with that.


This struct stuff don't make any sense to me. Java, C# and many other
language
multithread, have everything shared and still are able to have
finalizer of some
sort.

I understand, though, that they take steps to ensure that the finalizer
is run in one thread and no other thread still has access to it - i.e.
it is converted back to a local reference.

Why couldn't a shared object be destroyed ? Why should it be destroyed
in a
specific thread as it can only refer shared data because of
transitivity ?

How can you destroy an object in one thread when another thread holding
live references to it? (Well, how can you destroy it without causing
corruption bugs, that is.)

Why would you destroy something that isn't dead yet ?

Reply via email to