by ttkciar · 7y ago · 0 comments
You -can- explicitly manage threads and processes like in other languages, but much of the time there is a more lightweight, expressive construct available.
For instance, you can turn this loop: foreach(ref i; arr) i = i * i;
Into a parallelized loop by simply: foreach(ref i; parallel(arr)) i = i * i;
Example was shamelessly lifted from: https://tour.dlang.org/tour/en/multithreading/std-parallelis...
I’m curious how the actor model works on a large system with lots of 3rd party libraries (or even different development teams) when you can’t guarantee that everyone is using it.