Sharing of resources and Semaphores in Real-Time