0

I have 2 doubts

1)what is the default value of a mutex ?
Is it 0 or 1?

2)Why cant we have a code like, this to solve the Concurrency issues. I mean, i know its not possible, but this was asked to me at an interview ...

if(pid == 1)
{
  /* give CS to Process1 */
  set pid =2;
}

else
{
 /* give CS to Process2 */
 set pid=1;
}
2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by pyTony
0

thanks for the reply ,
default value - what i meant was, say, the Producer-consumer Problem , where Producer puts something into the queue until the limit of the queue(n) and the Consumer consumes from it until 0.
So, initially does the queue have anything in it ??
That is, can the consumer consume anything initially ???

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.