Re: Forcing a thread to use a specific processor?



SetThreadAffinityMask. You can check this out with my Thread Affinity Explorer that you
can download from my MVP Tips site.

Generally, binding a thread to a particular processor will overall result in poorer
performance than if you just let the scheduler choose the processor, because it means that
it will be forced to wait if that processor is busy, even if other processors are idle.

One technique that is used to improve user responsiveness (as opposed to program
performance or system performance) is to allow the main GUI thread to run on any
processor, but the worker threads to run on any processor but procesor 0 (the low-order
bit of the mask), and then boost the priority of the worker threads. This will cause the
scheduler to favor your threads, but not make the GUI sluggish, because the GUI (and other
normal threads) will compete for CPU0 while the worker threads consume CPU1..n.
joe

On Mon, 9 Jul 2007 22:18:59 -0500, "Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote:

Now that we have dual core and quad core processors is there
an easy way to force a thread to use a particular one of
these core processors in Windows XP or Vista?

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Forcing a thread to use a specific processor?
    ... but the worker threads to run on any processor ... scheduler to favor your threads, but not make the GUI ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Forcing a thread to use a specific processor?
    ... allowable set, the scheduler is free to run any thread on any processor, and that thread ... but the worker threads to run on any processor ... but not make the GUI ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Forcing a thread to use a specific processor?
    ... somewhat for Vista, which may not use an available processor if it is not the local ... but the worker threads to run on any ... but not make the GUI ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: How do I get CFormView to move while busy processing.
    ... I should point out that the reason the PeekMessage doesn't work is that it quantizes the ... A similar problem arises if there is a lot of traffic from a thread to the main GUI ... you can fill the queue up with posted messages, which first of all makes the GUI ... See my essays on threading on my MVP Tips site. ...
    (microsoft.public.vc.mfc)
  • Re: MVC/MVP swing GUI
    ... open source project so I can look at more than just the GUI) written following the MVP pattern. ... - Swing's own architecture isn't modeled as "pure" MVC or MVP, ... Each text field has an own Model, or should the sum of the text entries (some kind of data set) be the Model? ...
    (comp.lang.java.gui)