Re: Strange exception using threads

2012-06-24 Thread Sean Kelly
On Jun 23, 2012, at 9:31 AM, simendsjo wrote: > On Sat, 23 Jun 2012 18:29:37 +0200, simendsjo wrote: > >>auto tid = spawnLinked(&writer); > > auto tid = spawn(&writer); of course With spawnLinked the child will send a termination message to the parent as well.

Re: Strange exception using threads

2012-06-23 Thread Minas Mina
Thank you very much :) I like the "you are done :)" approach!

Re: Strange exception using threads

2012-06-23 Thread simendsjo
On Sat, 23 Jun 2012 18:29:50 +0200, Ali Çehreli wrote: receive( (Tid id, int i) { writeln("Secondary thread: ", i); }, (OwnerTerminated exc) // <- as a message { done = true; }

Re: Strange exception using threads

2012-06-23 Thread simendsjo
On Sat, 23 Jun 2012 18:29:37 +0200, simendsjo wrote: auto tid = spawnLinked(&writer); auto tid = spawn(&writer); of course

Re: Strange exception using threads

2012-06-23 Thread Ali Çehreli
On 06/23/2012 09:05 AM, Minas Mina wrote: > I am using a secondary thread to send messages to it so it can print > those messages. > std.concurrency.OwnerTerminated@std/concurrency.d(248): Owner terminated The OwnerTerminated exception is thrown when a worker attempts to receive a message to no

Re: Strange exception using threads

2012-06-23 Thread simendsjo
On Sat, 23 Jun 2012 18:05:47 +0200, Minas Mina wrote: I am using a secondary thread to send messages to it so it can print those messages. import std.stdio; import std.concurrency; void main() { auto low = 0, high = 10; auto tid = spawn(&writer);