Original Post
Programming one project, I came to very strange behavior of Windows when writing a while(true) loop.
Consider the following winpseudocode:
WinMain()
{
CreateFirstThread();
CreateSecondThread();
while(true);
}
FirstThread()
{
while(true);
}
SecondThread()
{
while(true);
}
Yes, as far as I can understand the written above, nothing special is written, the code should execute perfectly well [not taking into consideration the meaninglessness of the code]. And the good part is - it does execute perfectly, on Windows 2000 Professional. But blah, choose Windows 2000 Advanced Server and there you go - 99% CPU time consumed on the program immediately after the execution, and after a while precious Windows dies.
I thought that might be because of the threads, and brought the source to a state looking like:
WinMain()
{
while(true);
}
But uh, this didn''t change a thing.
I guess the problem is clear, and the big thing is that I can''t go along with Windows 2000 Professional, at least Windows 2000 Server is mandatory. So before I uninstall Advanced Server and try with Server, maybe you can help me a bit.. Thanks a lot.
--
I hate you.