Page 1 of 1

VWait() does not detect vertical blank when window is minimized

Posted: Fri Nov 22, 2019 3:01 pm
by amyren
I noticed this in one of my programs, I did use VWait() in the mainloop to avoid high CPU load.
This works well as long as the program is active. But if I minimize the window (on windows x64) it will suddenly use lots of CPU.
Similar on Amiga, if HideDisplay() is used to iconify the program, it will consume cpu when VWait() is used to restrict the main loop.

To test, just use the included Hollywood example, eg. DisplayStyle.hws, in the main loop insert VWait and replace WaitEvent with CheckEvent.

I have resolved this on my program, but I found it worth mentioning here.
Is this a bug?

Re: VWait() does not detect vertical blank when window is minimized

Posted: Sat Nov 23, 2019 12:54 pm
by airsoftsoftwair
Yes, it is a bug but it was fixed already a few months ago. Here is the history entry:

Code: Select all

- Fix: Starting from Hollywood 6.0 VWait() only waited if the current display was open; this was not a
  good idea because it is often used as a throttle (e.g. by Hollywood Designer) and with that design
  the CPU usage dramatically increased as soon as a display was minimized 

Re: VWait() does not detect vertical blank when window is minimized

Posted: Sat Nov 23, 2019 2:58 pm
by amyren
Thanks.
When you say "Fixed", does it mean that it will be available in next Hollywood 9, or is it a patch that can be downloaded now?

Re: VWait() does not detect vertical blank when window is minimized

Posted: Sat Nov 23, 2019 3:11 pm
by jPV
amyren wrote: Sat Nov 23, 2019 2:58 pm When you say "Fixed", does it mean that it will be available in next Hollywood 9, or is it a patch that can be downloaded now?
It'll be available in the next Hollywood version/update, be it 8.1 or 9.0 or whatever. I guess it should be highly critical bug if it'd be released by other ways.