Why doesn't VTK_SMP_IMPLEMENTATION_TYPE default to STDThread?

Hi all,

Why does VTK_SMP_IMPLEMENTATION_TYPE default to Sequential instead of STDThread?

Are there platforms where STDThread doesn’t exist/work?

Cheers,

Sean

1 Like

Good question, but note that std::thread is extremely sensitive to any hint of race conditions. I have also seen it much, much slower than TBB, and even slower than sequential on occasion. I personally never use std::thread except when debugging, and always prefer TBB.

Yes, the deadlocks that were still around in STDThread blocked it from being the default. See .gitlab/ci/ctest_exclusions.cmake for the tests that seem to be affected.

@Charles_Gueunet

Sounds like a job for Thread Sanitizer!

I should restore my TSan nightly build… I believe I disabled it because it was taking a long time, but perhaps I can build less of VTK to get things going.

I also have a patch coming that fixes at least one TSan complaint…

Sean

Yes, tsan is extremely useful but as you say slow. It would be good to work through the std::thread issues that Ben referred to.

I have an MR somewhere to re-enable the sanitizers, but the CI is a complete mess and I don’t have time to make it happy enough to turn on.

Let me just cheer on from the sidelines to getting std::thread in shape. I guess once it’s mature enough, it could be used for the PyPI wheels? That would be great.