Comments (1)
The above looks like you've quoted this article: https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html.
I don't see an issue here. This is my understanding. The idiom used there is not the same as what is used by Hollow. The article is about "just-in-time" construction of a member object being read without "synchronization" (i.e., barrier or lock of some sort). The Hollow code is constructing an object read from a ConcurrentHashMap, which is "synchronized" (not by the keyword necessarily but by the use of a barrier or lock). An update has a happens-before relation with get so all writes before the update (i.e. the construction of schema) will be visible to whoever called get.
What's inside the synchronized block is only there to construct a single schema. If that were not there, the only consequence would be two constructed schema's instead of one, not a data inconsistency issue.
Looking past the "double-checked" idiom critique, underneath is the general issue of making a constructed object visible to multiple threads before the writes of that object are fully visible. This applies to discoveredSchemas, but that already has the "additional synchronization" because it is declared final. That ensures all threads see the fully constructed Map<>.
I think this a correct analysis - if not, please be more specific on what the issue is.
from hollow.
Related Issues (20)
- HollowAPI will provide stale data when missing delta files
- Infinite CPU-consuming Loop in VarInt.readVLong/readVInt on truncated InputStream
- Error while generating API models for Scala based DTOs HOT 1
- question about this run in docker
- Error while writing the new state HOT 2
- Condition 'doubleSnapshotConfig.allowDoubleSnapshot()' should be negated
- SQL-like querying for Hollow Explorer
- Hollow depends on org.apache.velocity:velocity:1.7 HOT 1
- The new explorer-ui will break if there are more than 1 cookie
- Verify local blob store is being used HOT 1
- PerformanceAPI directory not matching package
- errors during consumer async refresh are hidden
- Jackson com.fasterxml.jackson.databind.util.RawValue is not storing in blob HOT 1
- What are the available indexes for Hollow HOT 1
- Change javax to jakarta HOT 1
- Generated client API does not apply default value consistently for missing fields
- Type count validator on first cycle after startup does not even initiate the validator HOT 1
- The releaseYear fields are not zig-zag encoded in memlayout-object.png
- [Question] How to produce dataset with millions of data in batches
- Too many snapshot files when S3 is not avaliable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hollow.