[fpc-devel] Rather large flaw in TJSONConfig component
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Tue Jun 22 12:07:41 CEST 2010
Graeme Geldenhuys schrieb:
> FPC finally has a working TMultiReadExclusiveWriteSynchronizer
> implementation (tiOPF implemented it's own), but I don't know if that
> implementation is available for FPC 2.4.x yet, or if it is still only in
> Trunk. Either way, TXXXConfig classes could use the same synchronizer to
> manage access - with a bit of refactoring.
I don't see how this can be useful. Either the first user keeps the file
open for writing, so that every other request will fail, or the file is
closed after reading, so that any number of writes can follow.
For source code we have several VCS, which try to keep the files
consistent, but even these fail to merge multiple changes from time to
time. And such systems are quite useless with other (config) data, where
little context is available for synchronization attempts - here the XML
format provides the most context information, with best chances for
successful merges. In either case every update should read the current
file contents, and merge it with the local changes before writing the
entire file back to disk. Then also writelocks make sense, so that only
one update can be applied after another.
DoDi
More information about the fpc-devel
mailing list