Windows Process remains after closing the program with high CPU usage


i am developing a program with several opengl windows in different threads. Now i am facing the problem that the program doesn’t properly closes and the Main thread is still remaing with high CPU usage. It happend on every PC with NVIDIA GPU. The stack trace of the thread shows this:


I changed already the thread optimization setting but it doesn’t helps. Only the stacktrace looks a little differnt with a wait call.
There are different PCs with Windows7 and Windows 10. I checked diffent cards like Quadro K2200, Quadro 600 or Quadro FX580.
Also i checked differnt driver versions from 2014 to the latest one(368.86). In the older driver versions the single threads doesn’t close properly. In the newer versions something changes and the threads closes correct but the program not.
Than i complied the program in 32bit and it works all perfect.
Usually i run up to 7 opengl threads. If there is just one thread it also works.
The programm exits very quick after closing all the differnt opengl threads. When i call a Sleep for a few seconds it also works good. But it is bad solution in my eyes. I would like to understand the background. what is this thread doing and what can i do? Is this a knowing issue?

If you need more information please let me know



Could you share the minimum project/executable that can reproduce the problem so that we can try to help debug in house.