Re: processor time allocation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Do you happen to update UI in OnIdle function? It's a wrong place.

"RossD @ Cadwell" <RossDCadwell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F0A4B049-FCED-4745-9DE6-347B35F05847@xxxxxxxxxxxxxxxx
> Wow! Fix it! Really? Why didn't I think of that?
>
> How about Microsoft fixing its task manager? This isn't the first time
> I've
> had problems with threads and the task manager. The last time Microsoft
> admitted that they had heard of my problem before but that they didn't
> know
> why it would be happening.
>
>
> "Alexander Grigoriev" wrote:
>
>> If the CPU load is not 100%, your app gets all CPU time it can use. If
>> your
>> app is not able to use all the CPU power, fix it.
>>
>> OnIdle() MFC function is called after the message loop has handled all
>> the
>> messages in the queue. It doesn't mean the system is or is not idle.
>>
>>
>> "RossD @ Cadwell" <RossDCadwell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
>> message
>> news:998F6DF7-89D1-4A27-B3DE-A2DADA8F33E7@xxxxxxxxxxxxxxxx
>> > If my app is getting all of the processor time that it requires, then
>> > why
>> > is
>> > the MFC idle function rarely running, why are all of the UI updates not
>> > occurring or occurring at very slow rates, why are my worker threads
>> > (which
>> > do all of the heavy processing) falling behind?
>> >
>> > My UI thread does nothing other than update the UI and accept user
>> > input,
>> > and yet it can't get processor time to even do that.
>> >
>> > And yet the operating system refuses to give my app more than 30 % of
>> > the
>> > available CPU time.
>> >
>> > Also note that I have implemented Michael's suggestion, and although it
>> > makes my 20 Hz thread run more smoothly, it does nothing to alleviate
>> > my
>> > real
>> > problem which I stated up front - although in different words.
>> >
>> > How do I get the operating system to allocate more CPU time to my app?
>> >
>> > "Mark Randall" wrote:
>> >
>> >> It was simply a comment that the task manager does not always say what
>> >> you
>> >> think its saying.
>> >>
>> >> If the CPU isnt maxed out (100% processor) than your application is
>> >> getting
>> >> all the processing power it needs.
>> >>
>> >> - Mark R
>> >>
>> >>
>> >> "RossD @ Cadwell" <RossDCadwell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>> >> > Did you have any thoughts on how to balance out my thread's CPU
>> >> > allocation?
>> >> > Or could you be more specific with your comments if they were
>> >> > intended
>> >> > to
>> >> > imply a solution?
>> >> >
>> >> > thanks
>> >> >
>> >> > "Mark Randall" wrote:
>> >> >
>> >> >> Its the percentage of the total usage shown I believe.
>> >> >>
>> >> >> Knocking out the sleep would just make it a huge great big loop
>> >> >> would
>> >> >> it
>> >> >> not?
>> >> >>
>> >> >> - Mark R
>> >>
>> >>
>> >>
>>
>>
>>


.



Relevant Pages

  • Re: Is delphi a good introduction to programming?
    ... >that when running the emulation in the idle loop, ... My app consumes about 1-2% CPU time, ... using the high-priority class, because a high-priority class ...
    (comp.lang.pascal.delphi.misc)
  • Re: Is delphi a good introduction to programming?
    ... > is that when running the emulation in the idle loop, ... > smoothly until some other application takes any CPU time, ... > my app stalls and stutters. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Explorer at 99% CPU constantly
    ... SP3 thinking it would fix the problem but it didn't. ... of the CPU time which I am sure is much better). ... Monitor that Ian was on about. ... and it was leading to weird .mpg file that ...
    (microsoft.public.windows.vista.performance_maintenance)
  • Re: A correct "mojave" experiment for Vista
    ... I was talking about a typical system running on older hardware then adding a service or app that takes a lot of CPU time. ... The OS is irrelevant in that when you split up the time each task gets, the tasks run slower. ...
    (microsoft.public.windows.vista.general)
  • Re: Parallels, M$ Virtual PC & VMWare - Re: For pmj
    ... but I will blame it on the lack of logic in Windows. ... When the script starts I got a pop up saying do you want to run this ActiveX control, I click Yes and off it goes. ... seconds, CPU time 30%-50%. ... I'll have a play with the C# app, I've probably misinterpreted something, it would make a good basis for a multi threaded test app. ...
    (uk.people.silversurfers)