openscenegraph / OpenSceneGraph

OpenSceneGraph git repository
http://www.openscenegraph.org
Other
3.24k stars 1.42k forks source link

std::atomic backend #1022

Closed glebm closed 3 years ago

glebm commented 3 years ago

Would it make sense to add an std::atomic backend? Or even replace all the existing ones with it?

std::atomic is standard in C++11 and above

robertosfield commented 3 years ago

So far I've kept the OSG working against older C++ version as some users are stuck on systems that won't support C++11.

It may be that for future stable releases we could just make C++11 a minimum and just replace use of OpenThreads completely. For the VulkanSceneGraph I've used C++11 threading and it works really nicely.

However, right now my focus is getting VulkanSceneGraph to 1.0, with the OSG in maintenance mode so am avoid new significant feature development in the OSG.

glebm commented 3 years ago

Noted.

If someone decides to revive this, here is a patch that replaces all backend implementations except Mutex with std::atomic: https://gitlab.com/OpenMW/openmw-android/-/blob/841887fc55bccb75f9de6a968035bbcd8aaca0ac/buildscripts/patches/osg/0001-Replace-Atomic-impl-with-std-atomic.patch