Help with concurrency - traversing a DAG
qznc
qznc at web.de
Fri Oct 18 12:47:36 PDT 2013
On Friday, 18 October 2013 at 16:31:13 UTC, tbttfox wrote:
> My not currently not working implementation has the workers
> make a pull request from the master.
As far as I understand you just want something working right now?
Then my suggestion would be to look into std.parallelism [0].
Create a task for each node without a parent. Let the tasks
create new tasks for their children.
This would implement your concept quite well. The queue is
actually the task queue of a thread pool. The nice thing, is that
all this queueing and synchronization stuff is already
implemented for you in the standard library.
You could try to make the DAG immutable and create a secondary
data structure for the evaluation results.
[0] http://dlang.org/phobos/std_parallelism.html
More information about the Digitalmars-d-learn
mailing list