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
segfault when printing to screen from within multithreaded loop #17388
Comments
If you just want to have something printed from within the threading loop for, say, debugging purposes then you can bypass Libuv with Threads.@threads for i = 1:10
ccall(:jl_,Void,(Any,), "this is thread number $(Threads.threadid())")
end |
@andreasnoack exactly so, thank you. |
@ranjanan Worth noting this in the threading documentation. This is a natural thing everyone will want to try, and our printing and i/o is not thread safe. |
Dup of #14494 |
Just to add to this: sometimes there's unintended I/O; for example, with depwarn. This code will cause segfaults in threads on Julia 0.6 even though there's no explicit output:
(it also had the effect of pegging CPUs at 100% until |
Nightly binary on OS X 10.11.5
The text was updated successfully, but these errors were encountered: