LinkTerminated without linked thread?

Sean Kelly sean at invisibleduck.org
Thu Jan 24 11:31:01 PST 2013


On Jan 24, 2013, at 9:58 AM, Stephan <stephan_schiffels at mac.com> wrote:

> On Thursday, 24 January 2013 at 17:12:49 UTC, Sean Kelly wrote:
>> 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.
> 
> But still, LinkTerminated needs to be thrown somewhere. And without spawnLinked I can't see why it should be thrown anywhere.
> I am trying to use a different setup now, with a fewer number of threads. Maybe that'll work.

It shouldn't be thrown unless you spawn with spawnLinked.  The code is pretty straightforward.  If you can come up with a repro of unexpected behavior, please file a bug report.


More information about the Digitalmars-d mailing list