removed semaphore. limiting threads works the same with OpenMP implementation