I confirm, it's 1)
Adding a flush just before reopening the file R-O for the RemoteString instance solves this problem. However, this isn't obvious (i.e. the R-O opening is lazily triggered by another RemoteString method).
I don't like, from a threading point of view, the RemoteString writing code. It takes the stream position before writing stuff in it, opening an opportunity window for a race condition.
Thierry
________________________________________
De : pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] de la part de Henrik Johansen [henrik.s.johansen@veloxit.no]
Date d'envoi : lundi 29 avril 2013 11:54
� : Pharo-project@lists.gforge.inria.fr
Objet : Re: [Pharo-project] cannot modify class comments on Linux
On Apr 26, 2013, at 8:06 PM, Nicolas Cellier wrote:
> To be perfectly clear, does the bug occurs
> 1) because we open a new file descriptor for read without flushing the old one for write,
> 2) or does it occur with a single file descriptor opened 'rw' ?
>
> If 1), then this is probably our fault.
> If 2), then I wouldn't expect such behavior.
1), different streams are used for reading/writing, to reduce threading errors in relation to position usage.
RemoteStrings have an unusual tendency to jump around a lot in the streams they're linked to, which is no fun if you, say, try and write new source at the same time in a different thread.
Cheers,
Henry