using semaphores to control GPUs