Archived

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

atjs

Letting Threads have a go at the CPU

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
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