[Q] Has SharedQueue a very subtle bug?

goran.hultgren at bluefish.se goran.hultgren at bluefish.se
Fri Apr 12 12:24:35 UTC 2002

Jon Hylands <jon at huv.com> wrote:
> On Fri, 12 Apr 2002 11:33:43 +0100, goran.hultgren at bluefish.se wrote:
> > I tried to provoke this error but failed - my testcode might have been
> > wrong. I know this might be "nitpicking" but I am curious and if it is
> > indeed a bug it could save someone hours of debugging chasing this down
> > - it wouldn't happen very often...
> Since Squeak uses a cooperatively-scheduled process model for processes
> that have the same priority, the only way this could happen would be for a
> higher-priority process to become available at the exact micro-second that
> the interpreter is between those two bytecodes in the method -- which seems
> unlikely, and also exactly the kind of bug that would be very hard to both
> reproduce and track down...

Yes, so I gather that your answer is that it can happen, right? I was
for a while what kind of "granularity" the process scheduling uses -
your answer
implies that it is on the bytecode level. So a Process switch can happen
between any bytecodes?

> Given that my 1.0 GHz P-III gets close to 100 million bytecodes/second
> (94,674,556 bytecodes/sec; 2,789,127 sends/sec), you'd need a timer
> resolution of about 5 nano-seconds to reliably reproduce this as a bug,
> which doesn't seem likely... 

My idea was to see if I could detect it when looping for a full night.
Sort of like the hunt for Higgins particle... ;-)
I think I will see if I can tweak that testcode a bit.

> Later,
> Jon

regards, Göran

More information about the Squeak-dev mailing list