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

Yakov Zhdanov commented on IGNITE-638:
--------------------------------------

Vlad,

One more point I missed in previous comment.

What is correct way out of this?
Imagine I have semaphore with 1 permit and 1 thread on some node (NODE_A) 
acquires it so semaphore becomes locked. Then 10 threads on 10 different nodes 
come and try to acquire, they fail and start waiting. NODE_A dies. Everyone 
else waits forever.

I think we need to track how many permits are owned by this or that node and 
automatically release them on node leave event. What do you think?

> 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)

Reply via email to