Getting started with threads in D

Henrik Valter Vogelius Hansson groogy at groogy.se
Sat Jun 16 18:15:44 PDT 2012


Hi again!

I have looked around a little with what D offers but don't know 
really what I should use since D offers several ways to use 
threads. Some more high level than others. Don't really also know 
which one would be suitable for me.

A little background could help. I am a game developer and during 
my semester I want to experiment with making games in D. I use 
threads to separate some tasks that can easily work in parallel 
with each other. The most common being a Logic/Graphics 
separation. But as development progresses I usually add more 
threads like inside graphics I can end up with 2 or 3 more 
threads.

I want to avoid Amdahl's law as much as possible and have as 
small synchronization nodes. The data exchange should be as basic 
as possible but still have room for improvements and future 
additions.

The Concurrency library looked very promising but felt like the 
synchronization wouldn't be that nice but it would provide a 
random-access to the data in your code. Correct me of course if I 
am wrong. Is there a good thread pool system that could be used? 
Does that system also handle solving dependencies in the 
work-flow? This is what we use at my work more or less.

In worst case scenario I will just use the basic thread class and 
implement my own system above that. Then there is the question, 
is there any pitfalls in the current library that I should be 
aware of?


More information about the Digitalmars-d-learn mailing list