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

Add read barrier in background thread. #285

Closed
wants to merge 1 commit into from
Closed

Conversation

pkernevez
Copy link
Contributor

When reading Psi file, we have to setup read barrier from a background thread.
From https://developerlife.com/2021/03/13/ij-idea-plugin-advanced/#background-tasks-and-multiple-threads---the-correct-way

val inventory = assessment.inventory()
val (trace, assessment, inventory) =
runReadAction {
val rTrace = traceSystemWithIndicator(progress, file, processName, matchLabels)
Copy link
Contributor

Choose a reason for hiding this comment

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

il y a déjà un runReadAction dans traceSystemWithIndicators

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Du coup tu suggères quoi on l'enlève de traceSystem ?
Je pense que ça ne pose pas de pb d'avoir une read action dans une autre vu qu'il a déjà le lock.

Ou alors tu est serein sur le fait que toutes les manipulations de Psi sont fait juste dans cette méthode et je reverse cette partie ?

Copy link
Contributor

Choose a reason for hiding this comment

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

oui je suggère qu'on merge pas la PR

La lecture du PSI est déjà protégée par runReadAction (cf. le code de traceSystemWithIndicator)

@pkernevez pkernevez closed this Aug 22, 2023
@pevab pevab deleted the setupReadBarrier branch September 12, 2023 20:21
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

Successfully merging this pull request may close these issues.

2 participants