concurrency problem with pointers

evilrat evilrat666 at gmail.com
Fri Jul 19 11:39:45 PDT 2013


On Friday, 19 July 2013 at 18:25:26 UTC, Ali Çehreli wrote:
> On 07/19/2013 11:07 AM, evilrat wrote:
>
> > i don't think this is compiler bug, it's just how it works.
>
> But what code needs toHash and others for the struct type even 
> though we are just passing a pointer around?
>
> > yet this is
> > another thing one must remember when writing library - never
> use struct
> > predefenitions(or any other forward refs).
> > so concluding all of this, it is clear this is a derelict
> library bug,
>
> I am not convinced yet. I think it is something that 
> std.concurrency is doing (perhaps because it relies on 
> Variant?). Otherwise there is no problem with what derelict 
> does. The following code compiles:

maybe you are right about Variant, and yet it still not compiler 
bug, but phobos bug. rewriting std.variant and std.concurrency 
just because of forward refs is no go.
i think problem is that with a struct we can't just generate code 
for this methods(toHash,opCmp,etc) by comparing its address, even 
if it's not extern(C/C++) and not found by linker, or do we 
actually could?



More information about the Digitalmars-d-learn mailing list