[PATCH] D32189: Implement StopTheWorld for Darwin
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 19 07:28:25 PDT 2017
fjricci marked 2 inline comments as done.
fjricci added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_stoptheworld_mac.cc:74-78
+ for (unsigned int i = 0; i < num_threads; ++i) {
+ if (threads[i] == mach_thread_self() ||
+ suspended_threads_list.ContainsThread(threads[i])) {
+ continue;
+ }
----------------
kubamracek wrote:
> Do you expect any performance issues from this O(n^2) behavior? What is the maximum reasonable thread count? Why do we even need to check for `ContainsThread`? Do you expect that `threads` contains duplicates?
I expect to be running this on programs with up to 250 threads or so, not sure what a normal maximum use case would be.
I based this on the Linux implementation, which does have the nested loop. That implementation is more complex, so it may be necessary there, but it should be fine to remove it here.
https://reviews.llvm.org/D32189
More information about the llvm-commits
mailing list