Thread local and memory allocation

deadalnix deadalnix at gmail.com
Tue Oct 4 02:32:04 PDT 2011


Le 04/10/2011 10:52, Walter Bright a écrit :
>
> Allocate an object, then cast it to immutable, and pass it to another
> thread.

That is explicitly said to be unsafe on D's website. As long as a 
reference exist in the creating thread, this should work, but if thoses 
references disapears, you'll end up with memory corruption.

This is why the type system is made for isn't it ? And if you decide to 
do funky stuff bypassing it, unsafe things can happen.


More information about the Digitalmars-d mailing list