Safe to use volatile bool to force another thread to wait? (C++)
问题 Everything I've read about volatile says it's never safe, but I still feel inclined to try it, and I haven't seen this specific scenario declared unsafe. I have a separate thread that renders a scene, pulling data from the main simulation thread. This has no synchronization, and works fine. The issue is that when the program exits, then renderer needs to stop pulling data from the simulation thread before the simulation thread can safely clean itself up without causing the renderer to attempt