Problem with receiveOnly and classes

kraybourne stdin at kraybourne.com
Tue Mar 27 06:59:41 PDT 2012


On 3/25/12 19:33 , Ghislain wrote:
> Hello,
>
> [...]
> I do not understand why an object of type A is fetched as a Variant, while
> a object of type B is received correctly.
>
> [...]
> Any idea?

Hi!

I get the same on Mac DMD 2.058. I have no idea. Looks like a bug to me, 
although I can't say which part is wrong/right.

The chapter on concurrency in TDPL ( 
http://www.informit.com/articles/article.aspx?p=1609144&seqNum=6 ) only 
ever uses values and arrays as examples, and ddocs sort of strategically 
says nothing, so I guess it's not really clear if passing objects should 
be possible at all?

Either way, I once tried to pass over "ownership" of trees of objects to 
other threads but gave up on that. I don't think std.concurrency and D 
really can work like that. (?) Concurrency seems to work much better 
when you pass messages and data, structs are fine, and then build object 
trees from that on the other side etc. Sorry I can't help more.


More information about the Digitalmars-d-learn mailing list