You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Krome Plasma (JIRA)" <ji...@apache.org> on 2016/07/19 08:30:21 UTC

[jira] [Comment Edited] (IGNITE-637) Implement IgniteReentrantReadWriteLock data structure

    [ https://issues.apache.org/jira/browse/IGNITE-637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15382969#comment-15382969 ] 

Krome Plasma edited comment on IGNITE-637 at 7/19/16 8:29 AM:
--------------------------------------------------------------

If you ask me any lock related feature would be a nice addition to ignite, especially when there is a combination of read+write :)
Another important question for you Vladisave, would ReentrantReadWriteLock impementation include fair ordering option ? 
Especially if you have multiple write lockers on multiple nodes and don't want them to just wait forever for a write lock, 
I have such a case when i need to do a  non-transactional bulk load of cache with streaming, but this can happen on multiple
nodes. Tried doing it with semaphores with draining, but then two writers can start drain permits at same time and eventually
end up in dead lock between them.


was (Author: kromulan):
If you ask me any lock related feature would be a nice addition to ignite, especially when there is a combination of read+write :)
Another important question for you Vladisave, would ReentrantReadWriteLock impementation include fair ordering option ? 
Especially if you have multiple write lockers on on multiple nodes and don't want them to just wait forever for a write lock, 
I have such a case when i need to do a  non-transactional bulk load of cache with streaming, but this can happen on multiple
nodes. Tried doing it with semaphores with draining, but then two writers can start drain permits at same time and eventually
end up in dead lock between them.

> Implement IgniteReentrantReadWriteLock data structure
> -----------------------------------------------------
>
>                 Key: IGNITE-637
>                 URL: https://issues.apache.org/jira/browse/IGNITE-637
>             Project: Ignite
>          Issue Type: Sub-task
>          Components: data structures
>            Reporter: Dmitriy Setrakyan
>            Assignee: Vladisav Jelisavcic
>
> We need to add {{IgniteReentrantReadWriteLock}} data structure in addition to other data structures provided by Ignite. {{IgniteReentrantReadWriteLock}} should have similar API to {{java.util.concurrent.locks.ReentrantReadWriteLock}} 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 readers and writers and allow user threads to block whenever needed to wait for a lock.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)