first parallelization via threadpool,3 times faster on 4 cores