Re: Is delphi a good introduction to programming?



On Tue, 10 May 2005 08:29:43 GMT, "Paul Dunn"
<paul.dunn4@xxxxxxxxxxxx> wrote:
<snip>

>The biggest problem I encountered (and have yet to find a solution for) is
>that when running the emulation in the idle loop, everything runs smoothly
>until some other application takes any CPU time, at which point my app
>stalls and stutters. My app consumes about 1-2% CPU time, and if another app
>takes any more than 4% CPU then my app is stalled. I can't figure that out
>at all. My loop consists of emulating a frame (20ms, or 69888 cycles) of Z80
>code, then sleeps in 1ms intervals until the full real 20ms has elapsed.
>This typically results in 18-19ms of sleep time per frame, but I still get
>the stuttering.
>
>I think it's a fault of application.run; but I have no idea how to get
>around it :(

Have you looked at the API: SetPriorityClass

<quote>
HIGH_PRIORITY_CLASS
Specify this class for a process that performs time-critical tasks
that must be executed immediately. The threads of the process preempt
the threads of normal or idle priority class processes. An example is
Windows Task List, which must respond quickly when called by the user,
regardless of the load on the operating system. Use extreme care when
using the high-priority class, because a high-priority class
application can use nearly all available CPU time.
</quote>



.



Relevant Pages

  • 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: processor time allocation
    ... Do you happen to update UI in OnIdle function? ... >> If the CPU load is not 100%, your app gets all CPU time it can use. ... >> app is not able to use all the CPU power, fix it. ...
    (microsoft.public.vc.mfc)
  • 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)