-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Remove lock in FunctionManager #2273
Conversation
694097f
to
4d87ba4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, the lock is not necessary for normal built functions.
But given your post of |
call function as filter with a little part of data returned. |
@@ -60,7 +60,6 @@ class FunctionManager final { | |||
Function body_; | |||
}; | |||
|
|||
mutable folly::RWSpinLock lock_; | |||
std::unordered_map<std::string, FunctionAttributes> functions_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'd better mark it const.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not help due to ref counter use atomic operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done.
Co-authored-by: trippli <[email protected]> Co-authored-by: dutor <[email protected]>
atomic operation acts like dead lock, and can not go out of the while loop if multi-thread access it frequently.