Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of RemoteRef #131

Merged
merged 1 commit into from
Dec 29, 2015
Merged

Fix usage of RemoteRef #131

merged 1 commit into from
Dec 29, 2015

Conversation

yuyichao
Copy link
Contributor

@tkelman
Copy link
Contributor

tkelman commented Dec 24, 2015

is this a compat.jl candidate?

@yuyichao
Copy link
Contributor Author

Possibly (Ref JuliaLang/julia#14458). Can both Future and RemoteChannel be changed to RemoteRef on 0.4?

@amitmurthy
Copy link

Not 100%

What will work by replacing Future/RemoteChannel with RemoteRef:

Future()
Future(pid::Integer)
RemoteChannel()
RemoteChannel(pid::Integer)

What will not:

RemoteChannel(f::Function)
RemoteChannel(f::Function, pid::Integer)

Also, since Future s are write-once, any code that relies on an exception on a second put! on a Future will fail. Practically, this may not be an issue.

@yuyichao
Copy link
Contributor Author

But it seems that code that want to support 0.5 (without depwarns) but don't want to use the new features should work if Future and RemoteChannel are defined as RemoteRef?

@amitmurthy
Copy link

Code written for 0.5 but needs to work on 0.4 will have to consider previously mentioned issues.

Code written for 0.4 that needs to work on 0.5 will have to deal with the following:

  • All remotecalls now return Future s instead of RemoteRef. So code collecting refs into an array defined as refs=RemoteRef[] will need to be changed to refs=Future[]. As with the comprehension syntax.
  • take! on a Future throws an exception, while on a RemoteRef would just block/succeed.
  • A second put! on a Future throws an exception, while on a RemoteRef would just block/succeed.

This is a breaking change and while some cases can be handled via Compat.jl, I don't think we can handle all cases.

@yuyichao
Copy link
Contributor Author

I'm more thinking about having a Compat entry to avoid the version check due to renaming in simple cases like this. If this is not the case in general we can probably leave it as is.

yuyichao added a commit that referenced this pull request Dec 29, 2015
@yuyichao yuyichao merged commit 01ab147 into master Dec 29, 2015
@yuyichao yuyichao deleted the yyc/fix-remote branch December 29, 2015 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants