dynamic semaphore