www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.concurrent Tid vector initialization problem

reply Charles Hixson via Digitalmars-d-learn writes:
I'm planning an application where a series of threads each need to be 
aware of the Tids of all the others.  The number won't be known at 
compile time, but that doesn't seem to change the design.

All I've been able to come up with is a pair of loops, one to spawn the 
threads, and collect their Tids, and a second for each one to send its 
Tid to all the others.  receive doesn't seem to want to work with shared 
Tids.  My original design was to have a file level shared array of Tids, 
but receive (or possibly send) objected to attempts to use them.  They 
aren't known until they've been spawned, so I can't pass them as spawn 
parameters.  Etc.

This seems like a very clumsy initialization design.  Does anyone have a 
better idea?

(The rough estimate of the number of Tids is six, but that's likely to 
change from run to run.)
Jun 28 2015
parent =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 06/28/2015 01:50 PM, Charles Hixson via Digitalmars-d-learn wrote:
 I'm planning an application where a series of threads each need to be
 aware of the Tids of all the others.
The original thread did receive a couple of responses: http://forum.dlang.org/thread/mailman.5134.1435453322.7663.digitalmars-d-learn puremagic.com Ali
Jun 28 2015