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

Lockless FileExistsMap and position mapping #2442

Merged
merged 5 commits into from Dec 7, 2021
Merged

Conversation

pepeiborra
Copy link
Collaborator

@pepeiborra pepeiborra commented Dec 6, 2021

5th instalment from #2357

ghcide/src/Development/IDE/Core/FileExists.hs Show resolved Hide resolved
ghcide/src/Development/IDE/Core/FileExists.hs Show resolved Hide resolved
ghcide/src/Development/IDE/Core/Shake.hs Outdated Show resolved Hide resolved
Succeeded ver (fromDynamic -> Just v) -> pure (Just (v, mappingForVersion allMappings file ver))
Stale del ver (fromDynamic -> Just v) -> pure (Just (v, maybe id addDelta del $ mappingForVersion allMappings file ver))
Succeeded ver (fromDynamic -> Just v) ->
atomically $ Just . (v,) <$> mappingForVersion positionMapping file ver
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use one transaction including these and the stuff on line 358? Hm, maybe readPersistent gets in the way...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does

ghcide/src/Development/IDE/Core/Shake.hs Outdated Show resolved Hide resolved
@@ -328,7 +328,6 @@ getIdeOptionsIO ide = do
-- for the version of that value.
lastValueIO :: IdeRule k v => ShakeExtras -> k -> NormalizedFilePath -> IO (Maybe (v, PositionMapping))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly, I think this entire function is close to being in STM. Maybe just persistentKeys blocking it. Not sure if that's desirable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is firmly in IO

@pepeiborra pepeiborra added the merge me Label to trigger pull request merge label Dec 7, 2021
@mergify mergify bot merged commit a83c850 into master Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants