Re: Detecting infinite loops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 28, 2008 at 2:25 PM, yogeshwar sonawane <yogyas@xxxxxxxxx> wrote:
Hi all,
Suppose, I have an application or library code containing following :-

while (expected condition has not occurred)
{
   handling of expected condition
}

If i'm not wrong, you mean 'while (expected condition has not occurred) ;' (note the semicolon)
Otherwise, it does not make sense logically.

IMHO, busy waiting like this would not be recommended in any app, and not at all inside kernel code.
In case, there is absolutely no choice but to wait on a while(), the simplest way to let the user know about the internal state of your app/library is by having (a) log statement(s) inside the loop.

HTH. CMIIW...

Best regards,
Pranav
http://pranavsbrain.peshwe.com
 


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux