-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
callback functions see "old world" in 0.6 #19774
Comments
This describes a expected behavior so this is not a regression but simply a breaking change. The |
The fix of this (adding doc or add a slightly cheaper way to call something in the latest world) won't be breaking......... |
We need documentation of this, and to update the blog post. Can we have Why does a call to a |
Inference cannot infer anything about a newer world so any change in world age has to be an optimization barrier. We also need to be consistent on what do we treat as optimization barrier and failure to do that is one part of #265. Since a function call can be optimized, it must never be an optimization barrier, i.e. the dispatch and the body of |
But a call to a |
The semantics shouldn't be inference dependent unless we have a clear rule of what's inferrable. |
Presumably |
The result can be |
Sure, but if it is not typeasserted, or is only typeasserted to an abstract type like |
No. I think it's a bad idea to treat it like that. There's nothing special of it and it'll be really bad if |
Adding a |
+1 for
|
Looks like |
…g#19774) without using eval
Regarding your comment elsewhere, maybe |
That will put a lot of overhead for almost all |
…g#19774) without using eval
Yeah, I guess that would kill performance for calling any function from the cfunction. |
…g#19774) without using eval
…g#19774) without using eval
…g#19774) without using eval
@yuyichao, was this closed by a commit? |
…g#19774) without using eval
add invokelatest function to work around world-age problems (#19774) without using eval use invokelatest in libuv getaddrinfo callback update manual to mention invokelatest
It seems much harder to pass a proper closure as a callback function in Julia 0.6 than in previous versions due to #17057. In particular, the method
described in the manual andin this blog post no longer works: passing theFunction
via a "thunk"void*
that is called from acfunction
fails because theFunction
sees an "old world age".See JuliaPy/PyCall.jl#343 and JuliaMath/Cubature.jl#22 and the mailing list, for example, but this will affect any package wrapping a C library that expects callback functions.
In PyCall, @yuyichao suggested using
eval
, but this is clunky and seems likely to impose a large performance penalty. Is there a better solution?The text was updated successfully, but these errors were encountered: