Subject: Assignment mp2 (This message is being sent to all CPSC 322 students) Unfortunately some (more or less) arbitrary names I picked seem to have led some people completely off the road and into the weeds.. I chose the name enqueue() and dequeue() ONLY because that is what the IBM mainframe OS called the facility you are emulating. I should have called them alloc_resource() and free_resource() though it should be clear that I could have also named them mickey() and minnie() or sylvester() and tweety() without affecting what the functions do. Anyhow it appears that (understandably) my choice of names has led some people to conclude that enqueue() (sylvester()) should be in the business of adding qeltypes to the qcb's queue and the dequeue() (tweety()) should be in the business of removing them. Unfortunately this conclusion would be ABSOLUTELY WRONG and will lead to a broken program. ----------------- The reality is that qeltypes should be added (when necessary) to the qcb's queue in SYLVESTER() before the thread waits on the condition variable. qeltypes should be removed from the qcb's queue ALSO IN SYLVESTER() AFTER a thread wakes up and realizes that its qeltype is at the head of the queue AND it is safe for it to access the resource in the requested way (READ or WRITE). Any attempt to add or remove qeltypes from the qcbtype's queue in TWEETY() is FATALLY FLAWED! ------------------ You MUST keep the function names enqueue() and dequeue() but if it helps you to think of them as sylvester() and tweety() or alloc_resource() and free_resource() please do so.