LinkTerminated without linked thread?

Sean Kelly sean at invisibleduck.org
Thu Jan 24 09:12:42 PST 2013


On Jan 24, 2013, at 5:58 AM, "monarch_dodra" <monarchdodra at gmail.com> wrote:

> On Thursday, 24 January 2013 at 13:45:18 UTC, David Nadlinger wrote:
>> On Thursday, 24 January 2013 at 10:57:26 UTC, Stephan wrote:
>>> So my first question is: Where does the LinkTerminated Exception come from, when the only functions from std.concurrency that I use are "spawn" and "receiveOnly".
>> 
>> To track this down, what about looking at the std.concurrency source and placing a breakpoint at the appropriate line in MessageBox.get()?
>> 
>> David
> 
> Yeah, I've been playing with std.concurrency too lately, and getting random bugs. I'll try to formalize them into formal requests.
> 
> BTW: Question: Is "LinkTerminated" a priority message? I've been avoiding using SpawnLinked because I've been unable to effectively end my workers. Maybe I just suck though...

It's a control message. These are messages generated automatically by std.concurrency rather than sent by the user. They live in the normal message queue and so are processed when receive doesn't find a match earlier in the queue. The idea is that if an owner sends a spawned thread a bunch of messages, the spawned thread should have an opportunity to process those messages before receiving an OwnerTerminated message.  Making them priority messages would make designing predictable algorithms difficult. 


More information about the Digitalmars-d mailing list