[squeak-dev] CurrenReadOnlySourceFiles (was: Re: Question about inlining | How to access named temps in FullBlockClosure?)

tim Rowledge tim at rowledge.org
Tue Mar 31 22:51:06 UTC 2020

> On 2020-03-31, at 3:31 PM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
>  Have a look at the senders of #readOnlyCopy. Many of them were added 10+ years ago, 

IIRC that was added almost at the very beginning of Squeak. I had to do an entire fake-filing-system VM layer to allow RISC OS to cope with the very weird seeming idea of allowing multiple openings of the same file. It certainly wasn't a thing inherited from Smalltalk-80v2 - I would have had to do sometihng similar in '87 if it were.

> I agree with what you wrote about method changes, but reading the sources concurrently is still a possibility, especially when multiple UI processes can exist at the same time (e.g. that's what opening a debugger does, right?).

We should have the sources file opened once for reading and the changes file opened once for read/write. We should handle everything else by providing redirected access from streams of whatever sort and a a sensible set of primitives. 

A read should be atomic and specified with the starting point, the number of bytes to read and where to store them; it should return the number of bytes read or an error code. A write should be atomic and specify the start point, the number to write and the place to read from; it should likewise return the number written or an error code.

That way having a bunch of streams connecting will work safely; you read from one and it cannot be mangled by another action moving the file position in the midst of the read/write.

tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
You never finish a program, you just stop working on it.

More information about the Squeak-dev mailing list