|
There is a delay in the loop. My curiosity was about how others set up the loop. Guess I should have been more specific with the code example. There are multiple jobs pulling entries off of the data queue. A point of diminishing returns is reached after a certain number of jobs are running. The overall processing time goes up, not down. The system also needs to be shared with other jobs during this time. In a nutshell, the serving job reads a file and places key information on the data queue. The receiving jobs read the key information and perform the work. Loan amortizations, customer updates, file prep for the next day, etc. depending on the process. This used to be done by a single job reading the file one record at a time, processing that record, reading the next record, processing it, etc. Because the serving job is merely reading a file and writing to a data queue (maybe some minimal calculations) and the receiving jobs do all the work the serving job can walk through the file much faster than the receiver jobs can work off each entry. In some cases we push tens of millions of records through a single queue. IMHO it's also a good defensive programming practice to check if the queue is full. Rick
-----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Keith Carpenter Sent: Wednesday, January 10, 2007 2:51 PM To: RPG programming on the AS400 / iSeries Subject: Re: How would you code an infinite RPG loop - Was 1 <> 1 is true??? 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 oneof the Cwait() functions will in essence set a timer and go to sleep, consuming no processor cycles until the timer goes off.If the system is too slow to process the data queue and it is filling up, then not using a delay/wait would be sort of like flogging a dead horse. This is the first I've heard of where the data queue is hovering on full. But rather the coding for data queue full, it might make more sense to fix the process on the other end. Depending on how the application is designed, maybe multiple data queue server jobs (the job receiving the data queue entries) can be used. This can be a tunning technique (run more data queue servers when the data queue process is the bottle neck). Keith -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.
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.