3 ms·
Here is a technique I use to write multi-threaded code without too many bugs. I write sequential code, where most heavy work is arranged to fit in arrays and p
by stephc_int13 4y ago
Here is a technique I use to write multi-threaded code without too many bugs.
I write sequential code, where most heavy work is arranged to fit in arrays and processed
with a parallel_foreach function receiving a container and a worker that will be dispatched by the job system that is part of my framework.
The multiple cores are used mostly to accelerate the processing of heavy and linear tasks while the control flow is still purely sequential.
This is not optimal, but I think this is a reasonable tradeoff between simplicity and performance.