Not so sure. Even with un-interruptible primitives, the RemoteString is wrong.
It should be something like write chunk in a lock, return chunk final position once done. Then the RemoteString instance can compute the start position and store it. No more race condition for that one.
An, for anything which takes a readOnlyCopy, try to flush the RW one before (or just remove that optimisation of opening multiple streams; anything which tries to do data sharing via external files is asking for trouble).
Thierry
De : pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] de la part de Nicolas Cellier [nicolas.cellier.aka.nice@gmail.com]
Date d'envoi : mardi 30 avril 2013 11:24
� : Pharo Development
Objet : Re: [Pharo-project] RE : cannot modify class comments on Linux
I think this was written with write once, read many restriction...
However,
- If the write stream would just append and not mess with position:
- And if the whole chunk was written in a single primitive call,
Then the write could still be safe, because primitive are currently un-interruptible.
Otherwise, as for every shared ressource, proper locking should be used...
But let's not do it:
Indeed, if the changes is no more a code repository, but just becomes a failsafe change log, then we don't need anymore to log the content of code we import (with MC or fileIn or other means...).
Logging the root action should be enough (MCLoaderOrSomething loadFromURL: '....'!).
Thus, there would be no need for background logging, only the UI process would log things and thus the write once model would be simple enough.
So, IMO, it's not usefull to waste cycles on something complex here.
Thoughts?
Nicolas