www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Thread Building Blocks

reply "Ross Hays" <accounts rosshays.net> writes:
Does anybody know if there is a library like thread building 
blocks for D? I imagine that it hasn't been ported or anything 
given it is a C++ library and licensed inconveniently.

If not, is there something in Phobos similar to it or that would 
help in making it? I may try writing something like it if it 
doesn't already exist.
Jan 09 2014
parent reply "Kelet" <kelethunter gmail.com> writes:
On Thursday, 9 January 2014 at 19:15:50 UTC, Ross Hays wrote:
 Does anybody know if there is a library like thread building 
 blocks for D? I imagine that it hasn't been ported or anything 
 given it is a C++ library and licensed inconveniently.

 If not, is there something in Phobos similar to it or that 
 would help in making it? I may try writing something like it if 
 it doesn't already exist.
It seems to be somewhat similar to std.parallelism (http://dlang.org/phobos/std_parallelism.html)
Jan 09 2014
parent "Ross Hays" <accounts rosshays.net> writes:
 It seems to be somewhat similar to std.parallelism 
 (http://dlang.org/phobos/std_parallelism.html)
I have seen that before, didn't know if there was anything closer with the task scheduler and worker threads described in the documentation for TBB, or if that was the closest thing. I see that it does have a TaskPool and worker threads within that, but they seem to be only using a shared queue and individual worker thread queues. So a task spawning another task does not really have some of the efficiency benefits that it does in TBB (where the worker threads maintain a dequeue instead). I also didn't see any mention of task stealing, but maybe it does that internally. Not sure. I can take a look at the code for it I suppose.
Jan 09 2014