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

TimeZones.TZData.compile() fails on Julia 1.9.0-rc3 #430

Closed
kpamnany opened this issue May 1, 2023 · 1 comment
Closed

TimeZones.TZData.compile() fails on Julia 1.9.0-rc3 #430

kpamnany opened this issue May 1, 2023 · 1 comment

Comments

@kpamnany
Copy link

kpamnany commented May 1, 2023

Due to JuliaLang/julia#49094, the interactive thread(s) (if you start any) are now thread 1 (and up) and the default threads start after that. That breaks this assertion, which I don't think is necessary anyway?

I think this can be fixed with something like:

function empty_thread_local_caches(both_pools = true)
    tp = Threads.threadpool()
    Threads.@threads :static for i in 1:Threads.nthreads(tp)
        empty!(_tz_cache())
    end
    !both_pools && return
    if tp == :default
        if Threads.nthreads(:interactive) > 0
            fetch(@spawn :interactive empty_thread_local_caches(false))
        end
    else
        fetch(@spawn :default empty_thread_local_caches(false))
    end
end

Also, since this package uses thread-local data, you probably want to use maxthreadid() here instead of nthreads().

@omus
Copy link
Member

omus commented May 24, 2023

Fixed by #382

@omus omus closed this as completed May 24, 2023
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.

2 participants