|
The question was intended to be what is the best way to handle a situation where your program goes into an indefinite wait until a condition is met. One of the posts from the original thread mentioned never placing code in production similar to what I gave as an example. That got me to thinking, if it shouldn't be done this way, then how should it be done? No offense taken by the comment, just curious and always open to better ways of doing things.
Anything at all on the right hand side seems transparent enough for an infinite loop, whether 1=1 or 1<>-1 seems like a nit and a red herring to the question of 'how do I make my program pause/wait for a long time?'
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.
--buck
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.