Closed thobbsinteractive closed 1 year ago
Though my investigations at home I am seeing the Release code running multiple main render methods in parallel despite the fact I implemented even tighter locking controls last night that should force the wait in the main thread. I believe this maybe happening because either because I have not use the static std::atomic for the thread count or more likely the compiler optimizations are running more of the code it thinks that it is okay to run in parallel. If static std::atomic does not work I can either:
Adding the keys for each thead was not the solution. Neither was pragma optimize( "", off ).
std::atomic was the solution. std::atomic<bool> m_isTaskRunning;
Unfortunately adding locking did not fix the issue and in Debug builds the threading works perfectly. What I am seeing is some lines not being drawn before the render moves on to the next Polygon.