all your threads work like **one** thread. You can use only one variable for minimum and one for maximum instead of vector. Find _local_ minimum/maximum and then compare it with global min/max using mutex.