Implement a multiple-reader-single-writer lock given a
compare-and-swap instruction. Readers cannot overtake
waiting writers.



Implement a multiple-reader-single-writer lock given a compare-and-swap instruction. Readers canno..

Answer / raj

Semaphores

Is This Answer Correct ?    3 Yes 9 No

Post New Answer

More Puzzles Interview Questions

Jim lies a lot. He tells the truth on only one day in a week. One day he said: "I lie on Mondays and Tuesdays." The next day he said: "Today is either Sunday, Saturday or Thursday." The next day he said: "I lie on Fridays and Wednesdays." On which day of the week does Jim tell the truth?

6 Answers   NCR, TCS,


If you were to dial any 7 digits on a telephone in random order, what is the probability that you will dial your own phone number? Assume that your telephone number is 7-digits.

6 Answers  


You are in a boat with your mother and wife. Suddenly you are forced to drop somebody into water due to boat overloading. You cannot drop yourself. Whom will you drop?

29 Answers   IIM, Keyence,


4. There are five caps , 3 black and 2 white. three persons chander, sunder and maninder are standing one behind the other in a queue. the first person in the queue is chanbder and the last person is maninder . 3 caps rfrom the lot of fivce is taken and put on their heads. Maninder can see what the other two standing in front are wearing . sunder can see what chander is wearing. None of them can turn around and see what the person standing behind is wearing , they do not know the color of cap what they themselves are wearing . John comes and asks maninder,"what is the color of the cap your are wearing?", Maninder can see what sunder and chander are wearing, and based on that he says he doesn't know. sunder has over heard that answer. Now john asks sunder" what is the colour of the cap you are wearing". sunder can see chander and he has heard what maninder has said, and based on that he says he doesn't know. chander has overheard both sunder and maninder. so when john asks chander the same question, he tells the correct answer. What is the colour of the cap that chander is weaRing ? Please write in brief how did you reach to that conclusion.

7 Answers   3D PLM, College School Exams Tests,


What is the minimum number of numbers needed to form every number from 1 to 7,000? Example: To form 4884, you would need 2 4s & 2 8s. 4822 requires a 4, a 8, & 2 2s, but you would not count the numbers again that you had already counted from making 4884.

2 Answers  






what three specific job positions do you target from qatar airways group u.k?

0 Answers   Qatar Airlines,


greatest achievement in life

3 Answers  


4_4_4_4=22 use all sign of maths

0 Answers  


A person is standing at the top of a 100mt building, he has a rope 75mts long and the only way he can come down is through the rope. He can cut the rope also he can tie the rope at any point on the building, but he cant jump and ofcourse dont even think about the stairs :D Find out the best way he'll come down.

14 Answers   Compro, Huawei, Oracle, Tech Mahindra,


One of the four people - Mr. Clinton, his wife Monika, their son Mandy and their daughter Cindy - is a singer and another is a dancer. Mr. Clinton is older than his wife and Mady is older than his sister. 1. If the singer and the dancer are the same sex, then the dancer is older than the singer. 2. If neither the singer nor the dancer is the parent of the other, then the singer is older than the dancer. 3. If the singer is a man, then the singer and the dancer are the same age. 4. If the singer and the dancer are of opposite sex then the man is older than the woman. 5. If the dancer is a woman, then the dancer is older than the singer. Whose occupation do you know? And what is his/her occupation?

2 Answers  


if u love someone u can arrange these 10 letters in 5 words I H O M U R E Y N A

41 Answers   DQ Entertainment, Era Infra Engineering, Infosys,


You have 13 balls which all look identical. All the balls are the same weight except for one. Using only a balance scale, can find the odd one out with only 3 weighings? Is it possible to always tell if the odd one out is heavier or lighter than the other balls?

9 Answers   Sapient,


Categories