Safe Asynchronous Functions (was: Re: std.concurrency: Returning from spawned function )

Michel Fortin michel.fortin at michelf.com
Sat Sep 11 15:28:58 PDT 2010


On 2010-09-11 18:14:25 -0400, dsimcha <dsimcha at yahoo.com> said:

> Interesting.  Now that I've given it more thought, though, using this 
> is probably
> a bad idea for lightweight task-based concurrency because resetting TLS at all
> properly would require re-running thread-local module c'tors (arbitrarily
> expensive), not just blitting a few things (cheap).  I guess I'll have 
> to resort
> to disallowing arbitrary indirection in return types in any safe subset of
> std.parallelism.

You could still allow it for pure functions.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list