Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ggml: Fix data race in ggml threadpool (ggml-org#11736)
After the barrier in last iteration is executed, still the loop termination condition will be executed. However main thread can destroy the cgraph object and its nodes already, then another thread will access it, but the thing is already gone. Also trouble can happen when n_nodes == 0 or abort is called, but I'm not sure if the prior situation is possible. Last syncronization should be done after the loop to ensure the cgraph/cplan won't be accessed after the main thread exits from the function.
- Loading branch information