[ https://issues.apache.org/jira/browse/IGNITE-638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14971249#comment-14971249 ]
Yakov Zhdanov commented on IGNITE-638: -------------------------------------- Vlad, Great job! I reviewed the code and I really liked it! Couple of points though: # I think we can should without org.apache.ignite.internal.processors.datastructures.GridCacheSemaphoreImpl.Sync#threadMap. We need a bit another approach. Why do I need to increment waiters (globally in cache) for each thread in local JVM? Can we use JVM as a waiter and not to update global object for each thread? I think this can save a lot of cache operations. # Please add failover tests - if they fail we can always disable them unless fixed. # Please add tests for example you have added. See IgniteExamplesSelfTestSuite. # GridCacheSemaphoreImpl.initCnt - what is this for? Can we just remove it? # Do you think we really need {{fair}} semaphore? I doubt if this makes sense with distributed semaphore. # Do not forget about Apache copyright - I added missing I pushed my changes to {{ignite-638}} branch. Please review them and address my comments basing on mentioned branch. Looking forward to getting an update and next contribution! > Implement IgniteSemaphore data structure > ---------------------------------------- > > Key: IGNITE-638 > URL: https://issues.apache.org/jira/browse/IGNITE-638 > Project: Ignite > Issue Type: Sub-task > Components: data structures > Affects Versions: sprint-9 > Reporter: Dmitriy Setrakyan > Assignee: Vladisav Jelisavcic > Labels: features, newbie > Fix For: 1.5 > > > We need to add {{IgniteSemaphore}} data structure in addition to other data > structures provided by Ignite. {{IgniteSemaphore}} should have similar API to > {{java.util.concurrent.IgniteSemaphore}} class in JDK. > As an example, you can see how > [IgniteCountDownLatch|https://github.com/apache/incubator-ignite/blob/master/modules/core/src/main/java/org/apache/ignite/IgniteCountDownLatch.java] > is implemented in > [GridCacheCountDownLatchImpl|https://github.com/apache/incubator-ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java] > class. > In general we need to have an entity in ATOMIC cache storing number of > permits and allow user threads to block whenever no more permits are > available. -- This message was sent by Atlassian JIRA (v6.3.4#6332)