learn semaphore and share memory