use `filesystem-change-evt' for collection paths only if low-latency

Specifically, this change disables the use of inotify() for detecting
changes to collection-links files, because the latency is too large
on some (many?) Linux configurations. (The fallback is to detect changes
to a links file by reading the whole content every time.)
This commit is contained in:
Matthew Flatt 2013-07-15 08:55:44 -06:00
parent df79198e6e
commit 9aee8b53d9
3 changed files with 906 additions and 900 deletions

File diff suppressed because it is too large Load Diff

View File

@ -466,15 +466,17 @@
"(lambda() #f)"
"(lambda()(raise exn)))))"
"(let((dir-evt"
"(and(vector-ref(system-type 'fs-change) 2) "
"(let loop((path path))"
"(let-values(((base name dir?)(split-path path)))"
"(and(path? base)"
"(if(directory-exists? base)"
"(filesystem-change-evt base(lambda() #f))"
"(loop base)))))))"
"(loop base))))))))"
"(if(not(file-exists? path))"
"(cons #f dir-evt)"
"(let((evt(filesystem-change-evt path(lambda() #f))))"
"(let((evt(and(vector-ref(system-type 'fs-change) 2) "
"(filesystem-change-evt path(lambda() #f)))))"
"(when dir-evt(filesystem-change-evt-cancel dir-evt))"
"(cons"
"(let((p(open-input-file path)))"

View File

@ -555,15 +555,17 @@
(lambda () #f)
(lambda () (raise exn)))))
(let ([dir-evt
(let loop ([path path])
(let-values ([(base name dir?) (split-path path)])
(and (path? base)
(if (directory-exists? base)
(filesystem-change-evt base (lambda () #f))
(loop base)))))])
(and (vector-ref (system-type 'fs-change) 2) ; 'low-latency ?
(let loop ([path path])
(let-values ([(base name dir?) (split-path path)])
(and (path? base)
(if (directory-exists? base)
(filesystem-change-evt base (lambda () #f))
(loop base))))))])
(if (not (file-exists? path))
(cons #f dir-evt)
(let ([evt (filesystem-change-evt path (lambda () #f))])
(let ([evt (and (vector-ref (system-type 'fs-change) 2) ; 'low-latency ?
(filesystem-change-evt path (lambda () #f)))])
(when dir-evt (filesystem-change-evt-cancel dir-evt))
(cons
(let ([p (open-input-file path)])