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 MAY 2010 12:29:41PM Terry Rainville wrote:

In AREV3.111 we use TAME to remove the CPU usage by an idle machine.

In OI I am trying to make a similar thing.

I either would like to have a routine start a program on a regular basis.

OR

I have created a program that loops until a set amount of time, problem with this approach is the CPU is being eaten up, is there anyway to make this work better.


At 29 MAY 2010 05:13AM Eric wrote:

/* requires this DLL prototype entry in your record for DLL_KERNEL32

KERNEL32

ULONG STDCALL Sleep(ULONG) AS DONTASKTHEEMU

*/

In the editor, from the Exec box, enter the command

run declare_fcns "DLL_KERNEL32"

* Then in your program you can

DECLARE SUBROUTINE DONTASKTHEEMU

DONTASKTHEEMU(200)

* You may alter the value to suit your hardware.

* This sheds CPU load by returning timeslice control

* to Windows to process its own event queue (and other tasks,

* threads and events like keystrokes and screen refreshes

* and mouse moving).

Or else you can use YIELD() - see pg. 503 of the OI Programmer's reference manual.

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/915f341bd33bf0d585257731005a9be6.txt
  • Last modified: 2023/12/28 07:39
  • by 127.0.0.1