Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 9 Dec 2007 18:06:34 +0100 (CET)
Hello Andreas:
How I can change the priority in the Hollywood programs? because when I programmed one application the program with Hollywood take the CPU speed when there are others programs working in parallel, and also I have other doubt, the InstallEvenHandler for read the keyboard touch is any slow also there is some way for avoid it? and when I play some key as ESC the effect be itso facto? because now the action wait the cycle of the program.
Best regards from your friend Juan Carlos.
[09 Dec 2007] Priority
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[27 Dec 2007] Re: Priority
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 27 Dec 2007 00:13:18 +0100
This would eat up all your CPU. Instead use a timer to ensure that the game loop isn't executed more often than 30 times a second or so, e.g.
And to answer your question: There's NO WAY to give Hollywood a higher priority because that's not what it was meant for. Hollywood was concepted to run smoothly in a multitasking environment, side by side with other programs.
If a Hollywood program eats up all your CPU, it's probably not written correctly. Make sure that you do not use any polling loops. E.g. something like this is bad:Hello Andreas:
How I can change the priority in the Hollywood programs? because when I programmed one application the program with Hollywood take the CPU speed when there are others programs working in parallel, and also I have other doubt, the InstallEvenHandler for read the keyboard touch is any slow also there is some way for avoid it? and when I play some key as ESC the effect be itso facto? because now the action wait the cycle of the program.
Code: Select all
Repeat
p_GameLoop()
Forever
Code: Select all
; run p_GameLoop 30 times per second
SetInterval(1, p_GameLoop, 1000 / 30)
Repeat
WaitEvent
Forever