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

[acl]: Simplify AclOrch class locking schema. #205

Merged
merged 1 commit into from
May 5, 2017

Conversation

oleksandrivantsiv
Copy link
Collaborator

Lock mutex only at the beginning of critical sections.

Lock mutex only at the beginning of critical sections.
Copy link
Contributor

@stcheng stcheng left a comment

Choose a reason for hiding this comment

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

Please wait for Qi's approval.

@qiluo-msft
Copy link
Contributor

qiluo-msft commented May 5, 2017

@oleksandrivantsiv
Copy link
Collaborator Author

Mutex is used to prevent any multiple access from different thread to AclOrch class data. We accessing AclOrch class from two threads. Main thread for write operations (create/delete tables, rules, counters) and counters thread to read counters. In both threads entry points are guarded with mutex. There is no chance that one thread will interrupt another in a middle of work. Can you please explain how it is possible to invalidate cont iterator and where?

Copy link
Contributor

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

I double checked. The mutex looks good to me.

@oleksandrivantsiv oleksandrivantsiv merged commit 49c556c into sonic-net:master May 5, 2017
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants