In C, I am utilizing pthreads in order to perform computations on a shared array across pthreads. Each of the pthreads is distinctly given offsets so that their area of computation has no overlap.
Example:
- Thread 0 updates array[0] thru array[9]
- Thread 1 updates array[10] thru array[19]
- Thread 2 updates array[20] thru array[29]
Are mutex locks still necessary in this case if none of the computation overlaps and they are not reliant on the updates of neighboring indices across thread boundaries?