4 ms·
> lack of thread local storage is not an issue We've had it since C++11. http://en.cppreference.com/w/cpp/language/storage_duration http://en.cppreference.com/
by clishem 9y ago
> lack of thread local storage is not an issue
We've had it since C++11. http://en.cppreference.com/w/cpp/language/storage_duration http://en.cppreference.com/w/cpp/language/storage_duration
- asveikau 9y agoI think android ndk still barfs on c++11 tls and the earlier language extensions that came before it like __thread. It's not uncommon to be working with language implementations that are missing things like that. (I remember MS's version of it produced binaries that would not run on XP - maybe less important today but I had a run-in with that circa 2009.)
- iainmerrick 9y agoReally? That's disappointing. Good old bad old NDK strikes again. I really don't understand why Google doesn't seem interested in fixing it.
- pjmlp 9y agoThey are fixing it, but NDK team seems to be a very small team, from the commits and gitHub issues. https://android.googlesource.com/platform/ndk/+/master/docs/Roadmap.md https://android.googlesource.com/platform/ndk/+/master/docs/... You can already use clang 5.0 on the NDK, so even early C++17 support is possible. I don't know about TLS support. The NDK is only there for high performance graphics (vulkan), realtime áudio, SIMD and bringing native libraries from other platforms. So apparently their motivation is that devs should touch the NDK as little as possible.
- iainmerrick 9y agoYeah, it just seems like they have the resources to support a bigger NDK team if they cared to do so. There plenty of apps that could really use a well-supported NDK. Games and audio apps for a start.
- pjmlp 9y agoGoogle released ARCore last week. "ARCore works with Java/OpenGL, Unity and Unreal and focuses on three things:" https://android-developers.googleblog.com/2017/08/arcore-augmented-reality-at-android.html https://android-developers.googleblog.com/2017/08/arcore-aug... Which makes quite clear that even in AR, the role of the NDK is to support Java, Unity and Unreal applications, not to be used alone. I am fine with it, given the security issues with the native code so we should actually minimize its use, I just would like they would provide better tooling to call framework APIs instead of forcing everyone to write JNI wrappers by themselves.
- iainmerrick 9y agoAs a counter-example, they also just announced AAudio, and that's a C API: https://developer.android.com/ndk/guides/audio/aaudio/aaudio.html https://developer.android.com/ndk/guides/audio/aaudio/aaudio... So they are still using C as a lingua franca for some low-level parts of the system. But without putting much effort into improving the C toolchain. I'm not very familiar with Unreal but I understand it's a C++ library, so it seems like that would benefit from a solid C++ toolchain too.
- pjmlp 9y agoI don't know about TLS, but NDK is already using clang 5.0 and my code is C++14.
- asveikau 9y agoYes I know they have recent clang. But does tls work? Last I knew, no. Note clang is not the only variable here. You need support from the dynamic linker. Edit: some googling suggests they may have added this support last year with some caveats.