about event
-
while (!bEnd) { Sleep(0); }
andHANDLE hEventEnd = CreateEvent(...); WaitForSingleObject(hEventEnd...);
---------------------------------------------- which better?HOW WHAT wrote:
hile (!bEnd) { Sleep(0); }
is obviously a disaster.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
HOW WHAT wrote:
hile (!bEnd) { Sleep(0); }
is obviously a disaster.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Sleep(0) plainly does nothing, and so you're going to start another thread, but at the same time, have your main thread check a bool over and over again, as fast as it can ? The mechanisms like WaitForSingleEvent exist precisely to stop people doing stuff like a hard loop to check a bool.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Sleep(0) plainly does nothing, and so you're going to start another thread, but at the same time, have your main thread check a bool over and over again, as fast as it can ? The mechanisms like WaitForSingleEvent exist precisely to stop people doing stuff like a hard loop to check a bool.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
CPU resources... a while the is always looping takes al the computer resources in order to be done as fast as possible, in the other way is like a callback, the OS handles it...