added thread pool and semaphore implementations