Implement dynamic semaphores