[squeak-dev] Re: browsing method speed

Eliot Miranda eliot.miranda at gmail.com
Mon Jan 21 23:48:33 UTC 2013


Hi Tim,


On Mon, Jan 21, 2013 at 3:42 PM, tim Rowledge <tim at rowledge.org> wrote:

>
> On 21-01-2013, at 3:21 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
>
> > How do we make that single copy thread-safe?
>
> If you refer to the problem that I am familiar with, by getting rid of the
> four primitives primitiveFileRead, primitiveFileWrite,
> primitiveFileGetPosition & primitiveFileSetPosition; replace them with
> primitiveFileReadFileIDFilePtrIntoArrayStartingAtCount &
> primitiveFileWriteFileIDFilePtrFromArrayStartingAtCount
>

Alas it bites at a slightly higher-level than that also.  Yes, the
decoupling of positioning and reading is a problem for thread-safety.  But
so is the single buffer and the single position.  e.g. if one were to call
your unified primitive below to fill the buffer that wouldn't prevent
another thread reading at a different position into the same buffer and
trashing the contents from the POV of the first thread. Since the
programming tools are essentially single-threaded it's not *that* bad a
problem, unless you're debugging source access (I *think*).

That way there is no gap between setting the file position and
> reading/writing. Some OS's (coughRISC OS) have this as the base api anyway.
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> "How many Teela Browns does it take to change a lightbulb?" "Stupid
> question."
>
>
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130121/4b48c4bd/attachment.htm


More information about the Squeak-dev mailing list