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

Better world age handling #168

Closed
maleadt opened this issue Apr 7, 2021 · 0 comments · Fixed by #394
Closed

Better world age handling #168

maleadt opened this issue Apr 7, 2021 · 0 comments · Fixed by #394

Comments

@maleadt
Copy link
Member

maleadt commented Apr 7, 2021

There's currently two related problems with our current world age handling:

  • we index the compilation cache directly with the world age (by taking the hash of the compiler job); instead we should intersect, and handle invalidation
  • when creating the FunctionSpec, we should have a way to pass the world age of the calling code, as opposed to the current global world age, which makes e.g. cufunction always look up the latest version of a potentially shadowed kernel (whereas it should be consistent with the world age of the caller); this probably requires a new intrinsic as both the current world age getter and the PTLS entry always point to the latest world:
     julia> worlds() = (ptls=Int(unsafe_load(convert(Ptr{Csize_t}, Core.getptls() + 8))), runtime=Int(Base.get_world_counter()))
     worlds (generic function with 1 method)
     julia> worlds()
     (ptls = 29611, runtime = 29611)
     julia> bar() = 42
     bar (generic function with 1 method)
     julia> worlds()
     (ptls = 29612, runtime = 29612)
     julia> Int(first(methods(worlds, Tuple{})).primary_world)
     29611
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 a pull request may close this issue.

1 participant