[BUG] Accessing source code is not thread-save
tim Rowledge
tim at rowledge.org
Wed Nov 2 15:32:40 UTC 2005
>
> Description: If two processes concurrently access the source code of a
> method they might get an invalid string that cannot be compiled.
This isn't particularly related to source code though; more a general
problem with the whole file accessing system. Unfortunately, Squeak
uses one primitive to position the 'current pointer' for an open file
and another to read x bytes from the current pointer. Obviously if
multiple threads are working on the same file there is a reasonable
chance that at some time the position and read/write will interleave
and screw up your day.
The same problem is there in many low level OS libraries - Squeak
just copied the model in the ANSI C stdio.h standard. I always did
think it was pretty stupid. A read/write(file, pos, numbytes) is much
safer.
It's one of the things that needs to be tackled by the File Team. Yet
another....
tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
More information about the Squeak-dev
mailing list
|