3 ms·
> That burden exists if you're calling into it from C, it's just implicit. That point is absolutely crucial. It's not just implicit, it's also often undocument
by adwn 5y ago
> That burden exists if you're calling into it from C, it's just implicit.
That point is absolutely crucial. It's not just implicit, it's also often undocumented. Recently, I tried to call LLVM's ORC2 JIT functions from two threads concurrently – an interface which was designed to be thread-safe [1]. And yet, actually doing that resulted in non-deterministic crashes and failed assertions. Guess it wasn't thread-safe after all... None of the types or function prototypes gave any indication that they weren't thread-safe, not to mention the documentation. And that's an extremely popular open-source project! The reality for most other C++ code looks even worse.
[1] https://llvm.org/docs/ORCv2.html#features https://llvm.org/docs/ORCv2.html#features
- ModernMech 5y agoThis is my experience as well. I feel like a lot of people who are experts at C++ and have been using it for literal decades now really fail to appreciate how hard it is to learn C++ in 2022. They have all of this stuff in their heads already and it's easy, so the vast amount of undocumented knowledge is invisible to them.