-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
UndefRefError with @threads for
multithreading on 1.3
#32846
Comments
Try with #32814. Otherwise the stack trace from the original error is not visible. |
OK I'll give it a try; the problem is that it's not deterministic, the tests ran fine on 1.3 on my Mac. |
Thanks; that gives insight into the problem (which is my fault). Clearly, my first attempt at making LRUCache.jl was not very successful. I have close to zero experience with multithreaded programming, but I think I now fixed the problem. I'll close this here. |
I'm having this issue as well, just as you describe, it doesn't seem to be deterministic. I run the exact same code multiple times and the error pops up some of the runs, seemingly randomly. This is my first experience with parallel programming as well. (Biting off a little more than I can chew.) How did you fix it? I'm on 1.5. |
I'm having similar issue as well, with version 1.8.2. Not deterministic as well, it tends to show up once a week. Since it is not deterministic, I am not able to give a MWE, but the pattern where the problem shows up is something like below: container = []
Threads.@threads for (key, value) in collect(some_dict)
push!(container, value)
end
res = vcat(container...) # where UndefRefError shows up sometimes |
Hello, I'm having the exact same problem in 1.9.1. Almost the same as mzy2240, @threads in a for loop and a push! (this time to a dataframe). But without the vcat. Error comes from the push! I think. Also not deterministic and only sometimes happens. I think this issue should be reopened. |
I don't think this is a bug and is just that |
@oscardssmith thanks for the explanation! Do you happen to have an example to show how @threads could work with lock? I tried but did not find any relevant example online. |
Yes, an example of how to avoid/solve the issue would be most welcome. |
I seem to get an error with some existing multithreaded code, using
@threads for
on 1.3. I don't think it is very deterministic, as I don't see it always, but the error does seem to originate in the code generated by the@threads
macro, and not in my own code, i.e.See a full report here:
https://travis-ci.org/Jutho/TensorKit.jl/builds/569731249
The error only occurs on 1.3 with multithreading, and all random numbers start from a common seed, so should the code that was ran should be the same on all platforms.
The text was updated successfully, but these errors were encountered: