From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] qunlock Date: Thu, 24 Jun 2004 15:58:49 +0500 From: dvd@davidashen.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: ab814864-eacd-11e9-9e20-41e7f4b1d025 > Maybe it's just that it's too early and I got soo few coffee, but, > do meant this, didn't you? No, I didn't; I mean that under certain condition each of the processes steps aside and opens the way for the other one until the other one executes at least once. The original code does exactly that. Your changes just spin each of the processes once the corresponding condition becomes true. > >> void >> A() >> { > > qlock(a); > againA: > >> qlock(q); >> if(x) { >> qunlock(q); >> goto againA; >> } > .... > > >> void >> B() >> { > > qlock(b); > againB: > >> qlock(q); >> if(y){ >> qunlock(q); >> goto againB; >> } > ....