for #24, seperate semaphore from share memory