rpuch commented on code in PR #4239:
URL: https://github.com/apache/ignite-3/pull/4239#discussion_r1724797111
##########
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteServerImpl.java:
##########
@@ -82,10 +86,33 @@ public class IgniteServerImpl implements IgniteServer {
private final ClassLoader classLoader;
- private volatile @Nullable IgniteImpl instance;
+ private final Executor asyncContinuationExecutor;
+
+ /** Current Ignite instance. This field is not volatile to make hot path
accesses from IgniteReference and other references
+ * faster (they always happen under a read lock, which guarantees
visibility of changes to this field). So we access
+ * this field in this object under synchronization ({@link #igniteMonitor}
serves as the monitor).
+ */
+ private @Nullable IgniteImpl ignite;
Review Comment:
I tried making the field volatile and rerun the benchmarks. Volatility
effect is not noticable at all. So I just simplified everything by making the
field volatile and removing `syncrhonized`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]