Interview Questions and Answers :: Cisco
Home > Experience Archives > Cisco > Interview Question Set 7 > Discussion
5. A user defined semaphore programmed was written for SemTake and SemGive with one global variable, which was updated on semtake/give.
Question was to point out if that program will work as per semTake/semGive requirement or not? What may be the problem with that?
Answer:
The problem was that while a process would be executing the semTake and another process may preempt before even the global variable is updated.
So, the second process may even take the sem.Which lead to problem ) . What could be a solution to it?
Amrita
16 Oct, 2016 8:31 PM
The problem was that while a process would be executing the semTake and another process may preempt before even the global variable is updated.
So, the second process may even take the sem.Which lead to problem ) . What could be a solution to it?
So, the second process may even take the sem.Which lead to problem ) . What could be a solution to it?
Report Error
Report Error
Please Login First Click Here