• Advertisement

Archived

This topic is now archived and is closed to further replies.

Letting Threads have a go at the CPU

This topic is 5482 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m building a DirectX application using (currently) 2 threads, one for the message loop and the other for the actual program ''flow''. (This is just like one of the articles, "Getting Rid of the Windows Message Pump & Solving the ALT-TAB Problem") Right now, I''m just blt-ing to the screen as fast as I can. As a result, the program loop uses almost all the CPU cyles, and the message loop is allocated almost none. This causes the window to ''stuck'', occasionally being unable to be moved, or minimized. How does one allow each thread a fair chance at using the CPU?

Share this post


Link to post
Share on other sites
Advertisement
Perhaps drop the priority of the drawing process, thereby letting everything else do as much as they need, and using the rest of the cycles. Could be wrong though.

Share this post


Link to post
Share on other sites
yep lowering the priority is the best bet, if you want to allocate more of a "fixed" time to it, use a sleep in one thread to allow the other more processing time

Share this post


Link to post
Share on other sites

  • Advertisement