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.
Thank you very much :)
I like the "you are done :)" approach!
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;
}
On Sat, 23 Jun 2012 18:29:37 +0200, simendsjo wrote:
auto tid = spawnLinked(&writer);
auto tid = spawn(&writer); of course
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
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);