JuliaSIMD / JuliaSIMD/Polyester.jl

Julia freezes when only one thread throws an error in an `@batch` block

Open
#31 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
285
Forks
20
PR merge metrics
No merged PRs in 30d

Description

This one was a real Heisenbug. Unstable simulations, which crashed in serial execution, froze on multiple threads, but trying to let it freeze on purpose made the bug disappear.

If only one thread (except the first one!) throws an error, Julia freezes.
MWE:
```julia
using Polyester

function foo()
println("Before")

@batch for i in 1:100
if Threads.threadid() == 2
error()
end
end

println("After")
end
```
Running this on more than one thread causes Julia to freeze after showing `Before`. This can be easily interrupted with Ctrl+C, which then *seems* to solve the problem for the session, but this is only due to #30, because now only one thread will be used.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.