You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 27, 2020. It is now read-only.
every time we try to modify the map, we must take a lock - this ensures only one thread can do it at once
we don't want to try to take the same lock twice - this will cause deadlock. For this reason, where we call other functions (e.g. 'get' calling 'add'), I've added a 'locked_add' function which you call if you;re already holding the lock. This is protected, so users of this class can't call it - only this class and its subclasses.
I was reluctant to add a lock here, as that might make call processing less efficient just to update some statistics - but I don't think we'll take the lock very often (only when we connect to or disconnect from a DGN) and obviously crashing is worse.
Don't we use ManagedTable for things like tracking numbers of different response types on Cx connections (via CxCounterTableImpl) - it's not just when we connect/disconnect a DGN? It seems like taking an additional lock on every access to that (and it looks to be every read, not just every add/remove) could be pretty expensive.
Not saying it's the wrong thing to do, but I think we to double-check the performance implications here.
This feels like quite an obvious issue - do you know how we expected this to work when we designed it originally?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The basic design is:
I was reluctant to add a lock here, as that might make call processing less efficient just to update some statistics - but I don't think we'll take the lock very often (only when we connect to or disconnect from a DGN) and obviously crashing is worse.