[jira] [Commented] (IGNITE-1439) CPP: Implement futures.

2017-04-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on IGNITE-1439:


Github user isapego closed the pull request at:

https://github.com/apache/ignite/pull/1847


> CPP: Implement futures.
> ---
>
> Key: IGNITE-1439
> URL: https://issues.apache.org/jira/browse/IGNITE-1439
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Vladimir Ozerov
>Assignee: Igor Sapego
>  Labels: cpp
> Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (IGNITE-1439) CPP: Implement futures.

2017-04-24 Thread Pavel Tupitsyn (JIRA)

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

Pavel Tupitsyn commented on IGNITE-1439:


Looks good to me.

> CPP: Implement futures.
> ---
>
> Key: IGNITE-1439
> URL: https://issues.apache.org/jira/browse/IGNITE-1439
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Vladimir Ozerov
>Assignee: Igor Sapego
>  Labels: cpp
> Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (IGNITE-1439) CPP: Implement futures.

2017-04-21 Thread Igor Sapego (JIRA)

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

Igor Sapego commented on IGNITE-1439:
-

Well, I guess, we can. Maybe I should start a thread on the dev list.

> CPP: Implement futures.
> ---
>
> Key: IGNITE-1439
> URL: https://issues.apache.org/jira/browse/IGNITE-1439
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Vladimir Ozerov
>Assignee: Igor Sapego
>  Labels: cpp
> Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (IGNITE-1439) CPP: Implement futures.

2017-04-21 Thread Pavel Tupitsyn (JIRA)

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

Pavel Tupitsyn commented on IGNITE-1439:


Thanks for the explanation. Looks good to me then.

> https://apacheignite.readme.io/docs/getting-started#section-prerequisites
We can change this, right? :) Why bother with 16 year old OS?

> CPP: Implement futures.
> ---
>
> Key: IGNITE-1439
> URL: https://issues.apache.org/jira/browse/IGNITE-1439
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Vladimir Ozerov
>Assignee: Igor Sapego
>  Labels: cpp
> Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (IGNITE-1439) CPP: Implement futures.

2017-04-21 Thread Igor Sapego (JIRA)

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

Igor Sapego commented on IGNITE-1439:
-

[~ptupitsyn] this design actually comes from the C++ itself to utilize it 
destructor-based resource control. You may look at this this way: 
{{SharedState}} is implementation of the needed functionality itself. This is 
something you would call {{FutureImpl}} in Java. {{Future}} class is something 
that provides public API (read access) and holds shared pointer to 
implementation, thus preventing its destruction. The {{Promise}} class here is 
something for which you do not have analogue in managed programming languages. 
Basically, it's guard-class, which holds shared pointer to implementation just 
as {{Future}} but provides write access to it. Its main role is to guarantee 
that that threads waiting on {{Future}}s gets released if something goes wrong 
- upon destruction it checks state of the {{SharedState}} class and if it is 
not marked as a completed yet it sets it to error state thus releasing all 
waiting threads.

As for naming - I used one which is commonly used in C++ community. 
(http://www.cplusplus.com/reference/future/future, 
http://www.cplusplus.com/reference/future/promise).

bq. Where does this come from? Windows XP is no longer supported even by 
Microsoft.
https://apacheignite.readme.io/docs/getting-started#section-prerequisites


> CPP: Implement futures.
> ---
>
> Key: IGNITE-1439
> URL: https://issues.apache.org/jira/browse/IGNITE-1439
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Vladimir Ozerov
>Assignee: Igor Sapego
>  Labels: cpp
> Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (IGNITE-1439) CPP: Implement futures.

2017-04-21 Thread Pavel Tupitsyn (JIRA)

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

Pavel Tupitsyn commented on IGNITE-1439:


> we have to support Windows XP
Where does this come from? Windows XP is no longer supported even by Microsoft.

> CPP: Implement futures.
> ---
>
> Key: IGNITE-1439
> URL: https://issues.apache.org/jira/browse/IGNITE-1439
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Vladimir Ozerov
>Assignee: Igor Sapego
>  Labels: cpp
> Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (IGNITE-1439) CPP: Implement futures.

2017-04-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on IGNITE-1439:


GitHub user isapego opened a pull request:

https://github.com/apache/ignite/pull/1847

IGNITE-1439: Added Futures for C++



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/gridgain/apache-ignite ignite-1439

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/ignite/pull/1847.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1847


commit e0f739ccaf2e43b3fb6ecf85635c847d761b2436
Author: Igor Sapego 
Date:   2017-04-18T17:44:57Z

IGNITE-1439: First prototype for the Windows is ready.

commit ef4f8d17914aaafb8db83b030eb806919fd2d39d
Author: Igor Sapego 
Date:   2017-04-19T14:52:55Z

IGNITE-1439: Added tests for SharedState

commit 3b24cc12964893ecbc4490286b2a5b89545fce96
Author: Igor Sapego 
Date:   2017-04-19T15:10:08Z

IGNITE-1439: Added tests for Future and Promise

commit 6f2f3cfbbf0f1ffab183ae3e7a847f42120a8a22
Author: Igor Sapego 
Date:   2017-04-19T16:09:49Z

IGNITE-1439: Refactoring

commit 52e01142b0279c597b96d723dd6aceaa90b92cde
Author: Igor Sapego 
Date:   2017-04-19T17:43:30Z

IGNITE-1439: Implemented ManualEvent for Linux

commit b6a3c123645c7a314127c1b5d7324d7e47fc6304
Author: Igor Sapego 
Date:   2017-04-20T16:35:02Z

IGNITE-1439: Added specialization for void

commit 84b9c90d0c50a21a69283cf66a239b2f6ed21e4d
Author: Igor Sapego 
Date:   2017-04-20T16:51:29Z

IGNITE-1439: Added tests for void specialization.




> CPP: Implement futures.
> ---
>
> Key: IGNITE-1439
> URL: https://issues.apache.org/jira/browse/IGNITE-1439
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Vladimir Ozerov
>Assignee: Igor Sapego
>  Labels: cpp
> Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (IGNITE-1439) CPP: Implement futures.

2017-04-19 Thread Igor Sapego (JIRA)

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

Igor Sapego commented on IGNITE-1439:
-

Implemented for Linux. Added tests. Considering adding methods for chaining.

> CPP: Implement futures.
> ---
>
> Key: IGNITE-1439
> URL: https://issues.apache.org/jira/browse/IGNITE-1439
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Vladimir Ozerov
>Assignee: Igor Sapego
>  Labels: cpp
> Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (IGNITE-1439) CPP: Implement futures.

2017-04-18 Thread Igor Sapego (JIRA)

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

Igor Sapego commented on IGNITE-1439:
-

Implemented prototype for Windows. As we have to support Windows XP I can't use 
Condition Variables 
(https://msdn.microsoft.com/en-us/library/windows/desktop/ms682052(v=vs.85).aspx),
 which would be perfect for cross-platform solution. So instead I used 
Manual-reset Event objects 
(https://msdn.microsoft.com/en-us/library/windows/desktop/ms682655(v=vs.85).aspx)
 and critical sections. Current implementation seems to be correct though I 
have not tested it properly yet.

Some details of current implementation:
To create {{Future}} one needs to first create {{Promise}} object. {{Promise}} 
is object which used to set value or error for the linked {{Future}} objects.
Once {{Promise}} created, one can call {{Promise::GetFuture()}} to get instance 
of related {{Future}} object. There may be unlimited number of futures for 
every {{Promise}}. {{Promise}} can't be copied though. Error or value can be 
set only once for the {{Promise}}. If someone tries to set value or error to a 
set {{Promise}} this will result in exception. If {{Promise}} instance gets 
destructed before any value or error has been set error is automatically set 
for all linked {{Future}} objects.

On any {{Future}} object user can call either {{Wait}}, {{WaitFor}} or {{Get}} 
methods. All these methods are blocking. If {{Get}} called on future for which 
error has been set this will result in exception.

Obviously enough, {{Future}} class is a part of public API, while {{Promise}} 
is internal class.

> CPP: Implement futures.
> ---
>
> Key: IGNITE-1439
> URL: https://issues.apache.org/jira/browse/IGNITE-1439
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Vladimir Ozerov
>Assignee: Igor Sapego
>  Labels: cpp
> Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)