[dmd-concurrency] draft 5

Sean Kelly sean at invisibleduck.org
Tue Jan 19 22:52:18 PST 2010


On Jan 19, 2010, at 10:44 PM, Kevin Bealer wrote:

> 
> 
> On Wed, Jan 20, 2010 at 1:39 AM, Sean Kelly <sean at invisibleduck.org> wrote:
> void fnB() {
>    // do something that takes a while
> }
> void fnA() {
> auto tid = 
>    spawn( &fnB );
> tid.wait();
> }
> 
> void main() {
>    auto tid = spawn( &fnA );
>    tid.wait();
> }

So we've created a dependency tree where a thread that spawns other threads must wait for them all to complete before terminating.  I suppose I just don't understand why it's such a bad thing for the main thread to terminate early that we should go to such lengths.


More information about the dmd-concurrency mailing list