Assignment 3(problem 3)

44 views
Skip to first unread message

Rahul Shah

unread,
Mar 10, 2012, 8:27:29 PM3/10/12
to asu-cse-430
Professor I cant understand the 3rd problem. How can we use semaphore
and implement it. ENQ checks the value to be equal to 1 but semaphore
always checks whether it is less than 0 and blocks if it is. But ENQ
blocks it if it is 1..

Partha Dasgupta

unread,
Mar 10, 2012, 9:22:40 PM3/10/12
to asu-c...@googlegroups.com
Anything to do with synchronization can be done with semaphores.... so if ENQ needs to block when a number is 1, build the thing... ok remember producer consumer, the producer blorcks when the buffer count is N. Also readers writes -- reader blocks when the writer count is 1... so need an integer variable?


--
You received this message because you are subscribed to the Google Groups "asu-cse-430" group.
To post to this group, send email to asu-c...@googlegroups.com.
To unsubscribe from this group, send email to asu-cse-430...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/asu-cse-430?hl=en.




--
Partha Dasgupta,
School of Computing Informatics, Arizona State University
EMail: par...@asu.edu
http://cactus.eas.asu.edu/partha
Reply all
Reply to author
Forward
0 new messages