-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[ISSUE #10159]修改mapperProxy单例 #10162
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #10162 +/- ##
=============================================
+ Coverage 51.67% 51.81% +0.13%
- Complexity 5077 5081 +4
=============================================
Files 873 873
Lines 27731 27731
Branches 3071 3071
=============================================
+ Hits 14331 14369 +38
+ Misses 12073 12037 -36
+ Partials 1327 1325 -2 see 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
为什么不用ConcurrentHashMap, 而是用hashmap+lock |
用ConcurrentHashMap读写确实没问题,但是在实例对象前一样要对ConcurrentHashMap加锁才能保证实例对象的原子性,所以采用读写锁,但我更想饿汉式加载,就不会存在线程安全的问题了 |
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.
写锁可以理解, 读锁是不是没有必要?
你的意思是,在loadInitial的时候加载完缓存? 也可以, 目前这个开关是动态的吗? 需要重启吗? |
重新看了下,还是坚持原本的改法了,开关有想法做成动态开关暂时不改这个 |
fix #10159