You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by gv...@apache.org on 2019/02/21 18:04:48 UTC
[ignite] branch master updated: IGNITE-11344: Performance drop fix:
ReentrantLock -> StripedLock. This closes #6150.
This is an automated email from the ASF dual-hosted git repository.
gvvinblade pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new f3b56f3 IGNITE-11344: Performance drop fix: ReentrantLock -> StripedLock. This closes #6150.
f3b56f3 is described below
commit f3b56f38765151879811aa7866f42efd6a4cc20a
Author: rkondakov <ko...@mail.ru>
AuthorDate: Thu Feb 21 21:04:34 2019 +0300
IGNITE-11344: Performance drop fix: ReentrantLock -> StripedLock. This closes #6150.
---
.../apache/ignite/internal/processors/cache/CacheGroupContext.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
index 2fd0fd7..4efb2da 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
@@ -26,7 +26,6 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cache.affinity.AffinityFunction;
@@ -54,6 +53,7 @@ import org.apache.ignite.internal.processors.query.QueryUtils;
import org.apache.ignite.internal.stat.IoStatisticsHolder;
import org.apache.ignite.internal.stat.IoStatisticsHolderNoOp;
import org.apache.ignite.internal.stat.IoStatisticsType;
+import org.apache.ignite.internal.util.StripedCompositeReadWriteLock;
import org.apache.ignite.internal.util.typedef.CI1;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.CU;
@@ -120,7 +120,8 @@ public class CacheGroupContext {
private List<GridCacheContext> contQryCaches;
/** ReadWriteLock to control the continuous query setup - this is to prevent the race between cache update and listener setup */
- private final ReentrantReadWriteLock listenerLock = new ReentrantReadWriteLock();
+ private final StripedCompositeReadWriteLock listenerLock =
+ new StripedCompositeReadWriteLock(Runtime.getRuntime().availableProcessors());
/** */
private final IgniteLogger log;
@@ -889,7 +890,6 @@ public class CacheGroupContext {
assert sharedGroup() : cacheOrGroupName();
assert cctx.group() == this : cctx.name();
assert !cctx.isLocal() : cctx.name();
- assert listenerLock.writeLock().isHeldByCurrentThread();
List<GridCacheContext> contQryCaches = this.contQryCaches;