[Pkg-octave-devel] Bug#550823: Updating load-path cache based on modification times probably a bad idea (was: Race condition between Octave 3.2.3 and unlink())

John W. Eaton jwe at octave.org
Wed Oct 21 14:01:53 UTC 2009


On 20-Oct-2009, Judd Storrs wrote:

| If we're already keeping track of when we last read a
| directory/file,

No, we were keeping track of the timestamp on the directory, and then
re-reading the list of files if the timestamp changed.  But that fails
for a sequence like

  system ("echo 1+1 > foo.m");
  foo
  system ("echo 2+2 > bar.m");
  bar

if the second call to system doesn't change the time stamp due to
limited resolution.

| wouldn't it be easiest to make the comparison know about the tolerance? i.e.
| use something equivalent to
| 
| if modtime + tolerance > cachetime
|    reparse
| endif
| 
| Then when the file/directory is older than the tolerance full caching would
| kick in?

OK, this seems better than forcing all of the directories in the load
path to be read again.  So how about the following change?  It seems
to work for me.

  http://hg.savannah.gnu.org/hgweb/octave/rev/d6b2b708b6b0

jwe





More information about the Pkg-octave-devel mailing list