digitalmars.D - std.concurrency doesn't like structs, classes?
- =?UTF-8?B?Ikx1w61z?= Marques" (7/7) May 23 2013 Hi,
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (5/11) May 23 2013 Why not provide a short program instead of describing? :)
- =?UTF-8?B?Ikx1w61z?= Marques" (4/6) May 23 2013 Thanks.
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (4/11) May 23 2013 As a workaround, try immutable(S*) (S is a struct). You must manage the
- =?UTF-8?B?Ikx1w61z?= Marques" (8/10) May 23 2013 I was actually investigating std.concurrency to try to understand
- Sean Kelly (12/18) May 24 2013 the lifetime of the object of course.
- =?UTF-8?B?Ikx1w61z?= Marques" (8/12) May 24 2013 I managed to solve the original problem, without using
- Sean Kelly (11/19) May 25 2013 as trouble with immutable however. Have you tried shared? std.concurre...
Hi, Has anyone tried the example from std.concurrency, but changing the int to an (immutable) struct or class? When I did that it failed with "Owner terminated". When I added a Variant to the receive() list, to try and fix that, I got an assertion failure (but the receive() handler was called). Luís
May 23 2013
On 05/23/2013 10:57 AM, "Luís Marques" <luismarques gmail.com>" wrote:Has anyone tried the example from std.concurrency, but changing the int to an (immutable) struct or class? When I did that it failed with "Owner terminated". When I added a Variant to the receive() list, to try and fix that, I got an assertion failure (but the receive() handler was called). LuísWhy not provide a short program instead of describing? :) Could be this bug: http://d.puremagic.com/issues/show_bug.cgi?id=5538 Ali
May 23 2013
On Thursday, 23 May 2013 at 18:09:34 UTC, Ali Çehreli wrote:Could be this bug: http://d.puremagic.com/issues/show_bug.cgi?id=5538Thanks. I guess it's that bug. But the bug is two years old, I'm not very hopeful to see a fix soon :(
May 23 2013
On 05/23/2013 11:16 AM, "Luís Marques" <luismarques gmail.com>" wrote:On Thursday, 23 May 2013 at 18:09:34 UTC, Ali Çehreli wrote:As a workaround, try immutable(S*) (S is a struct). You must manage the lifetime of the object of course. AliCould be this bug: http://d.puremagic.com/issues/show_bug.cgi?id=5538Thanks. I guess it's that bug. But the bug is two years old, I'm not very hopeful to see a fix soon :(
May 23 2013
On Thursday, 23 May 2013 at 18:38:05 UTC, Ali Çehreli wrote:As a workaround, try immutable(S*) (S is a struct). You must manage the lifetime of the object of course.I was actually investigating std.concurrency to try to understand the mechanism of dispatching the messages of different types (I needed to figure out a mechanism to accept subclasses). Since some things were not clear to me, I thought the easier solution was just to progressively strip std.concurrency, until I isolated the functionality I wanted. But now that seems a dead end, since std.concurrency itself does not work for classes.
May 23 2013
On May 23, 2013, at 11:49 AM, "Lu=EDs.Marques" = <luismarques gmail.com>" puremagic.com <luismarques gmail.com> wrote:On Thursday, 23 May 2013 at 18:38:05 UTC, Ali =C7ehreli wrote:the lifetime of the object of course.As a workaround, try immutable(S*) (S is a struct). You must manage ==20 I was actually investigating std.concurrency to try to understand the =mechanism of dispatching the messages of different types (I needed to = figure out a mechanism to accept subclasses).=20 Since some things were not clear to me, I thought the easier solution =was just to progressively strip std.concurrency, until I isolated the = functionality I wanted. But now that seems a dead end, since = std.concurrency itself does not work for classes. It should work for any type that Variant can represent. I know Variant = has trouble with immutable however. Have you tried shared? = std.concurrency finds a match via Variant.convertsTo, so it should be = able to handle subclassing.=
May 24 2013
On Friday, 24 May 2013 at 21:49:48 UTC, Sean Kelly wrote:It should work for any type that Variant can represent. I know Variant has trouble with immutable however. Have you tried shared? std.concurrency finds a match via Variant.convertsTo, so it should be able to handle subclassing.I managed to solve the original problem, without using std.concurrency as inspiration, like I mentioned I was doing. I have one more question regarding the original problem, but I posted that to .learn (by mistake, the first part of the post was a D / DMD issue, oops). Still, on this topic of std.concurrency, would it be too hard to solve the bug, for the benefit of others?
May 24 2013
On May 24, 2013, at 3:50 PM, "Lu=C3=ADs.Marques" <luismarques gmail.com>" pu= remagic.com wrote:On Friday, 24 May 2013 at 21:49:48 UTC, Sean Kelly wrote:as trouble with immutable however. Have you tried shared? std.concurrency f= inds a match via Variant.convertsTo, so it should be able to handle subclass= ing.It should work for any type that Variant can represent. I know Variant h==20 I managed to solve the original problem, without using std.concurrency as i=nspiration, like I mentioned I was doing.=20 I have one more question regarding the original problem, but I posted that=to .learn (by mistake, the first part of the post was a D / DMD issue, oops= ).=20 Still, on this topic of std.concurrency, would it be too hard to solve the=bug, for the benefit of others? The bug is with Variant, which std.concurrency uses. I'd love to see Varian= t improved though.=20=
May 25 2013