G
Guest
I have a real-time simulation where the logic flows most easily with a busy
while loop...
while (continueFlagSet)
{
if (EventDue)
ProcessNextEvent
}
Now, is there any thing to be concerned about here? With older versions of
Windows, I wouldn't have trusted the operating system to share the processor,
so I would have put an "else Sleep(0)" at the bottom of the loop, but this is
2005, and shouldn't I leave it to the operating system to manage processes,
and threads, without any hints from me?
When i'm running the application, there isn't any obvious impact on my other
Windows apps, or other threads in the same app, but I haven't tested this
thoroughly.
I am mindful of an excellent essay I read where the author listed "Sleep" as
one of the common sources of problems in windows apps, and which is almost
never needed. http://www.flounder.com/badprogram.htm
while loop...
while (continueFlagSet)
{
if (EventDue)
ProcessNextEvent
}
Now, is there any thing to be concerned about here? With older versions of
Windows, I wouldn't have trusted the operating system to share the processor,
so I would have put an "else Sleep(0)" at the bottom of the loop, but this is
2005, and shouldn't I leave it to the operating system to manage processes,
and threads, without any hints from me?
When i'm running the application, there isn't any obvious impact on my other
Windows apps, or other threads in the same app, but I haven't tested this
thoroughly.
I am mindful of an excellent essay I read where the author listed "Sleep" as
one of the common sources of problems in windows apps, and which is almost
never needed. http://www.flounder.com/badprogram.htm