[Fontconfig] Application startup performance
keithp at keithp.com
Thu Jan 14 22:39:37 PST 2016
Akira TAGOH <akira at tagoh.org> writes:
> As I mentioned in other mail, it was needed to avoid the races. to get
> rid of it completely, the logic of the cache updates may needs to be
> changed because keeping the directory information into the memory a
> long time causes that issue easily when recursively traversing
As long as the timestamp written to the cache is the directory change
time when the scanning starts, then applications starting after that
will re-scan the directory if it was changed while the first application
was scanning. I guess I don't see how this (which is what I think the
code does) could cause a race?
Alternatively, the library could re-stat the directory after building
the cache, and before replacing it in the file system, discarding and
rescanning the directory if the timestamp has changed. Write out the
cache to a temporary file, check the directory change time and rename
the file to the permanent name only if the timestamps were the same.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 810 bytes
Desc: not available
More information about the Fontconfig