Mutex and semaphores

Why we need synchronization?

Please thin about the below question, how will u solve the problem.
  • There are two process P1 (having statement S1) and P2 (having statement S2).  write a program to execute statements s2 only after S1?
  • Reader and writer problem, there one shared data is present between 5 readers and one writer.  here is required condition are, 
    • allow multiple readers to read at the same time. 
    • only one single writer can access shared data at the same time.
  • I2c buses acquired by the concurrent user process, how ur driver will handle the concurrent requests.? 
  • The dining philosophers problem states that there are 5 philosophers sharing a circular table and they eat and think alternatively. There is a bowl of rice for each of the philosophers and 5 chopsticks. A philosopher needs both their right and a left chopstick to eat. A hungry philosopher may only eat if there are both chopsticks available. Otherwise, a philosopher puts down their chopstick and begin thinking again.

Comments

Popular posts from this blog

Cryptography and Encryption Basics - I

Overview of ISO/SAE 21434 Standard

UDS Protocol Interview Question