Remove OpenMP lock functions

Locking objects slows loop execution. To fix: Rewrite the code without OpenMP lock functions. For example, allocating separate arrays for each thread and then merging them after a parallel recommendation may improve speed (but consume more memory).

Read More