This is an archive of the discontinued LLVM Phabricator instance.

Implement StopTheWorld for Darwin
ClosedPublic

Authored by fjricci on Apr 18 2017, 2:21 PM.

Event Timeline

fjricci created this revision.Apr 18 2017, 2:21 PM
kubamracek added inline comments.Apr 18 2017, 4:06 PM
lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
74–78

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?

87–89

Can we iterate over suspended_thread_list instead and skip the check for mach_thread_self?

91–94

clang-format please

fjricci marked 2 inline comments as done.Apr 19 2017, 7:28 AM
fjricci added inline comments.
lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
74–78

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.

fjricci updated this revision to Diff 95745.Apr 19 2017, 7:42 AM

Address comments

alekseyshl accepted this revision.Apr 19 2017, 2:07 PM
This revision is now accepted and ready to land.Apr 19 2017, 2:07 PM
This revision was automatically updated to reflect the committed changes.