Immutable Message Passing
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sun Dec 4 14:23:50 PST 2011
On 12/4/11 4:16 PM, Andrew Wiley wrote:
> So it looks like right now, message passing is copying objects, which
> seems very bad. Check this out:
> --------
> import std.stdio;
> import std.concurrency;
>
> class Bob {
> }
>
> void main() {
> auto tid = spawn(&func);
> auto bob = new shared(Bob)();
> writeln("bob is currently at ", cast(void*)(&bob));
This is the address of the reference, not that of the object. Use
cast(void*)(bob).
Andrei
More information about the Digitalmars-d
mailing list