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

Avoid throwing exceptions in reset_threads! #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

efaulhaber
Copy link

@efaulhaber efaulhaber commented Jan 7, 2025

With JuliaSIMD/ThreadingUtilities.jl#54, I get the same exception multiple times when I call Polyester.reset_threads! afterward:

julia> Polyester.reset_threads!()
ERROR: TaskFailedException
Stacktrace:
 [1] checktask(tid::Int64)
   @ ThreadingUtilities ~/.julia/dev/ThreadingUtilities/src/threadtasks.jl:74
 [2] foreach
   @ ./abstractarray.jl:3187 [inlined]
 [3] reset_threads!()
   @ Polyester ~/.julia/packages/Polyester/eqrC9/src/Polyester.jl:47
 [4] top-level scope
   @ REPL[26]:1

    nested task error: some error
    Stacktrace:
     [1] error(s::String)
       @ Base ./error.jl:35
     [2] macro expansion
       @ ./REPL[25]:4 [inlined]
     [3] #56
       @ ~/.julia/packages/Polyester/eqrC9/src/closure.jl:309 [inlined]
     [4] (::Polyester.BatchClosure{var"#56#57", ManualMemory.Reference{Tuple{…}}, false, Tuple{}})(p::Ptr{UInt64})
       @ Polyester ~/.julia/packages/Polyester/eqrC9/src/batch.jl:11
     [5] _call
       @ ~/.julia/packages/ThreadingUtilities/3z3g0/src/threadtasks.jl:11 [inlined]
     [6] (::ThreadingUtilities.ThreadTask)()
       @ ThreadingUtilities ~/.julia/dev/ThreadingUtilities/src/threadtasks.jl:29
Some type information was truncated. Use `show(err)` to see complete types.

julia> Polyester.reset_threads!()
ERROR: TaskFailedException
Stacktrace:
 [1] checktask(tid::Int64)
   @ ThreadingUtilities ~/.julia/dev/ThreadingUtilities/src/threadtasks.jl:74
 [2] foreach
   @ ./abstractarray.jl:3187 [inlined]
 [3] reset_threads!()
   @ Polyester ~/.julia/packages/Polyester/eqrC9/src/Polyester.jl:47
 [4] top-level scope
   @ REPL[26]:1

    nested task error: some error
    Stacktrace:
     [1] error(s::String)
       @ Base ./error.jl:35
     [2] macro expansion
       @ ./REPL[25]:4 [inlined]
     [3] #56
       @ ~/.julia/packages/Polyester/eqrC9/src/closure.jl:309 [inlined]
     [4] (::Polyester.BatchClosure{var"#56#57", ManualMemory.Reference{Tuple{…}}, false, Tuple{}})(p::Ptr{UInt64})
       @ Polyester ~/.julia/packages/Polyester/eqrC9/src/batch.jl:11
     [5] _call
       @ ~/.julia/packages/ThreadingUtilities/3z3g0/src/threadtasks.jl:11 [inlined]
     [6] (::ThreadingUtilities.ThreadTask)()
       @ ThreadingUtilities ~/.julia/dev/ThreadingUtilities/src/threadtasks.jl:29
Some type information was truncated. Use `show(err)` to see complete types.

julia> Polyester.reset_threads!()

julia> Polyester.reset_threads!()

This PR solves this problem.

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.

1 participant