Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 28 FEB 2003 12:26:39AM Paul Rule wrote:

I have a situation where I use a loop to check if a window is closed before continuing.

loop

until get_property("DRW_FIELDS","HANDLE")=" repeat

I found that in Windows 2000 etc that this showed 100% processor occupancy and slowed the computer down, so I added yield, flush & garbagecollect to end up with

loop

garbagecollect;flush
yield()

until get_property("DRW_FIELDS","HANDLE")=" repeat

Worked fine in most cases. Processor occupancy dropped right down.

Now I'm finding that even this method is causing 100% occupancy in some cases. Does anyone know how I can get around this?


At 28 FEB 2003 03:15AM Donald Bakke wrote:

Paul,

Try using a TIMER event.

[email protected]

SRP Computer Solutions, Inc.


At 02 MAR 2003 03:26PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Paul,

It may depend on how you have your shortcut Idle sensitivity set, and also "Exclusive in Foreground" should be unchecked. You might iterate YIELD() more frequently for later versions of the Windows operating system - it will help if you encapsulate these functions into a "superyield"

You might also prototype the Sleep(milliseconds) call in KERNEL32.DLL for some light relief. Fifty milliseconds is usually just a blink, but can help Windows "catch up" in such cases.

Steve

The Sprezzatura Group

World Leaders in all things RevSoft


At 02 MAR 2003 05:22PM Paul Rule wrote:

Thanks for the suggestion. I tried to get the sleep function to work but I'm having some trouble.

I added INT STDCALL sleep(VOID) to DLL_KERNEL32 (I guessed the parameters, probably wrongly)

Run declare_fcns "DLL_KERNEL32"

One of the messages says "$SLEEP WRITTEN TO SYSOBJ"

When I try to use call sleep(50) or x=sleep(50) in a program I get a message saying "Sleep function does not exist in dynamic link library KERNEL32"

What am I doing wrong? (Windows 2000)

By the way, the Idle intesity and that sort of stuff seems to only be an option in shortcuts that call dos programs.


At 02 MAR 2003 06:52PM Paul Rule wrote:

I've found a temporary solution. (Not very elegant)

If you perform a write inside the loop, the flush and garbagecollect seem to have something to do and the processor occupancy drops back to realistic levels.

eg:

for a=1 to 1000

 write "*" to syslists,"TEMP" else null
 flush;garbagecollect
 yield()

next a

Its interesting as a test if you do a simple loop without much going on inside it ties up all of the processor.

eg: for a=1 to 100000

x=x+1

next a

Why is this so?


At 03 MAR 2003 03:18AM Richard Bright wrote:

How about -

VOID STDCALL sleep(UINT)

Where INT is milliseconds. Note no return value.

(Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long))

Richard Bright

BrightIdeas New Zealand


At 03 MAR 2003 10:31AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

DLL function names are case sensitive when defining the prototype record, so you'll need to do this:

VOID STDCALL Sleep(UINT)

Which is probably why the program loader is complaining about not finding it…

The Sprezzatura Group

World leaders in all things RevSoft


At 03 MAR 2003 03:25PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

You want it to count slowly????

Paul - it's a "six stubbie discourse" I'll be happy to explain it sometime (perhaps at the next Melbourne Revelation User Group).

Steve

The Sprezzatura Group

World Leaders in all things RevSoft


At 03 MAR 2003 05:12PM Paul Rule wrote:

Thanks guys, thats done the trick!

Just a call sleep(1) fixes the processor occupancy issue.

Steve, whats your poision? Emu Bitter?

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/26ef581bdef4dce285256cdb001de830.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1