www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.concurrency.thisTid.send() feat. immutable(struct with several

reply Alexandr Druzhinin <drug2004 bk.ru> writes:
This code doesn't compiles http://dpaste.dzfl.pl/706a0d12
But if you comment one of arrays it will do. I take a look at varaint.d 
but can't understand why two arrays cause this error.
How can I send immutable struct that contains two or more arrays without 
any serializing?
Feb 26 2013
next sibling parent Alexandr Druzhinin <drug2004 bk.ru> writes:
27.02.2013 13:19, Alexandr Druzhinin пишет:
 This code doesn't compiles http://dpaste.dzfl.pl/706a0d12
 But if you comment one of arrays it will do. I take a look at varaint.d
 but can't understand why two arrays cause this error.
 How can I send immutable struct that contains two or more arrays without
 any serializing?
I've done it using pointer to the structure thisTid.send(&test_var); but using pointers isn't good practice and if somebody explain the reason of compiler complaining it would be great. thank in advance
Feb 26 2013
prev sibling parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Wednesday, February 27, 2013 13:19:22 Alexandr Druzhinin wrote:
 This code doesn't compiles http://dpaste.dzfl.pl/706a0d12
 But if you comment one of arrays it will do. I take a look at varaint.d
 but can't understand why two arrays cause this error.
 How can I send immutable struct that contains two or more arrays without
 any serializing?
I don't exactly what's going on with your code here, but std.concurrency is very buggy with regards to what types it will and won't accept - including both immutable and arrays. These are just some of the reported issues: http://d.puremagic.com/issues/show_bug.cgi?id=6585 http://d.puremagic.com/issues/show_bug.cgi?id=5538 http://d.puremagic.com/issues/show_bug.cgi?id=8853 http://d.puremagic.com/issues/show_bug.cgi?id=9122 Your problem may be one of those. std.concurrency is fantastic as far as its basic design goes, but its implementation still needs a fair bit of work. It generally works, but it's fairly easy to find corner cases where it doesn't work. - Jonathan M Davis
Feb 26 2013
parent Alexandr Druzhinin <drug2004 bk.ru> writes:
27.02.2013 14:19, Jonathan M Davis пишет:
 On Wednesday, February 27, 2013 13:19:22 Alexandr Druzhinin wrote:
 This code doesn't compiles http://dpaste.dzfl.pl/706a0d12
 But if you comment one of arrays it will do. I take a look at varaint.d
 but can't understand why two arrays cause this error.
 How can I send immutable struct that contains two or more arrays without
 any serializing?
I don't exactly what's going on with your code here, but std.concurrency is very buggy with regards to what types it will and won't accept - including both immutable and arrays. These are just some of the reported issues: http://d.puremagic.com/issues/show_bug.cgi?id=6585 http://d.puremagic.com/issues/show_bug.cgi?id=5538 http://d.puremagic.com/issues/show_bug.cgi?id=8853 http://d.puremagic.com/issues/show_bug.cgi?id=9122 Your problem may be one of those. std.concurrency is fantastic as far as its basic design goes, but its implementation still needs a fair bit of work. It generally works, but it's fairly easy to find corner cases where it doesn't work. - Jonathan M Davis
Thank you. I will learn to use reported issues.
Feb 27 2013