[Q] Has SharedQueue a very subtle bug?
Martin McClure
martin at hand2mouse.com
Fri Apr 12 19:12:46 UTC 2002
At 1:24 PM +0100 4/12/02, goran.hultgren at bluefish.se wrote:
>
>Yes, so I gather that your answer is that it can happen, right? I was
>wondering
>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
>theoretically
>between any bytecodes?
I believe that's true.
Good catch! Code inspection is a far easier way to catch threading
bugs than waiting for something bad to happen.
>
>> 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.
This bug may be impossible to reproduce on demand, though I don't
want to stop you from trying.
However, this is the kind of bug we should go ahead and fix. The code
is clearly unsafe, even if it's never been observed to fail.
-Martin
More information about the Squeak-dev
mailing list
|