Changed multiprocessing.ThreadPool by threads with semaphore closes #9