a demo for SEMAPHORE