1.using semaphore
2.using mutex