[Q] Has SharedQueue a very subtle bug?

Lex Spoon lex at cc.gatech.edu
Mon Apr 29 17:41:48 UTC 2002


goran.hultgren at bluefish.se wrote:
> "Lex Spoon" <lex at cc.gatech.edu> wrote:
> [SNIP]
> > #nextOrNil is pretty good.  It checks whether something is there, and it
> > removes it for you if there is.  It avoids race conditions and it's
> > really simple to reason about.  If it returns nil, then #isEmpty was
> > true.  If something is there, then you've got it with no further
> > question.
> 
> But as I wrote (if you read my earlier posting in this pretty long
> thread) it too has a problem.
> It doesn't wait on the readSemaphore which means it can go "straight by"

[problems with nextOrNil's implementation]

I just meant the API, not the implementation.  We don't need fancy
interfaces involving blocks, as far as I know, since #nextOrNil is
already such a nice simple interface.


Lex



More information about the Squeak-dev mailing list