3 ms·
* This doesn't need any synchronization between parallel threads - of course the final result is only formed when all the threads finish* I'm still confused. I
by joe_the_user 5y ago
* This doesn't need any synchronization between parallel threads - of course the final result is only formed when all the threads finish*
I'm still confused. If one calculates (x+y)*(z+w). You can divide the addition between threads but the multiplication has to happen once these two threads end.
If you're talking a "map-reduce" approach, as far as I understand it, the reduce has to happen once the mapping is done. Which would seem to require synchronization also.
- lmm 5y agoI think this is a semantic disagreement rather than a real one. A task in a map-reduce style model doesn't need to synchronize with any other task executing in parallel; of course a task cannot start until its inputs are available. If you want to implement that on top of a threads-and-shared-memory model then you'd need to use synchronization in your task scheduler, but from the point of view of code written inside the model there isn't and can't be any synchronization, which makes it much easier to write correct code.