Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VsChromium sometimes too aggressive at refreshing files #35

Closed
rpaquay opened this issue Aug 7, 2017 · 0 comments
Closed

VsChromium sometimes too aggressive at refreshing files #35

rpaquay opened this issue Aug 7, 2017 · 0 comments

Comments

@rpaquay
Copy link
Contributor

rpaquay commented Aug 7, 2017

VsChromium has 2 main components for synchronizing its index: one component keeps track of the file system structure (list of files and directories) and another keeps track of the contents of these files.

These 2 components are loosely coupled, so that both of them can end up aggressively (they both are multi-threaded) accessing the disk.

This does not happen when opening a "vs-chromium-project.txt" for the first time, because the file system scan happens on its own before the file contents loading can happen (the 2nd components needs to know what to load!).

However, this can happen with "incremental" changes. For example, when modifying a "vs-chromium-project-txt" multiple times with a few seconds interval can result in both components running in parallel.

The reason this can happen is that both components use distinct serialization queues to perform costly file system operations. So, while it is not possible for the file system scan component to run concurrently with itself, it can run concurrently with the file contents loading component.

The solution is to make both components use the same underlying queue, so file scan and file load are always serialized (long running, multi-threaded) operations.

rpaquay added a commit that referenced this issue Aug 8, 2017
This ensures that the tasks to rescan the file system and to load
file contents don't overlap.

This is the final fix for bugs #35 and #36.
@rpaquay rpaquay closed this as completed Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant