|
Buck, If your no-op loop is waiting on a data queue (i.e. it contains a call to QRCVDTAQ with the WAIT parameter set to -1) then the program will stop at the QRCVDTAQ call and it won't consume any CPU cycles anyway - it just goes to DEQW (dequeue-wait) status and won't fo anything until a data queue entry is added to the data queue
Buck wrote: > Running a no-op loop to consume cycles will get you a 'doesn't play nice > with others' grade, since this code will rapidly be consuming processor > cycles that other jobs will want. DLYJOB, or one of the C wait() > functions will in essence set a timer and go to sleep, consuming no > processor cycles until the timer goes off.
In other words, this code consumes (practically) no CPU: Wait = -1; // Wait forever for a data queue entry to appear dow 1=1; qrcvdtaq( parameters including Wait ); if DataLen > 0; exsr ProcessDataQueue; endif; enddo; Rory
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.