If you are working on a Unix/Linux system try "man select", otherwise search
the web. The select is an extremely basic IO call which waits on several
file descriptors simultaneously (plus possibly a timeout) and responds to
the first one that comes ready. It is typically found at the head of a loop
which is meant to sleep until "one of the above" wants to talk, but
UNFORTUNATELY modern coding practice tends to bury it deep down in call
nestings and sometimes a good deal of code search is required to locate it!

The problem I mentioned typically happens when some error condition is
returned by one of the file descriptors. Unless very carefully coded, this
returns instantly, the loop proceeds, the select is called again, the same
error returns instantly, etc, leading to a tight loop and 100% CPU
utilization.

Larry

On 3/26/08, Siva Prakash Reddy G <[EMAIL PROTECTED]> wrote:
>
>  Hi! Larry Dickson
>
>                                     Thank you very much for kind reply.
>
>                         I don't understand what you're trying to say and
> what do you mean by select is failing?.
>
>                                                 How to calculate cpu
> utilization in Linux , but here I'm executing top command there I'm seeing
> cpu idle is 98% and when I perform SNMP walk operation cpu idle is showing
> 0% .
>
>             Please help me out.
>
>
>
>             With Regards,
>
>     G. Siva Prakash Reddy.
>
>
>
>
>
> -----Original Message-----
> *From:* Larry Dickson [mailto:[EMAIL PROTECTED]
> *Sent:* Wednesday, March 26, 2008 7:27 PM
> *To:* Siva Prakash Reddy G
> *Cc:* [email protected]
> *Subject:* Re: cpu idle is 0%
>
>
>
> Have you checked whether a select is failing somewhere? It can generate a
> tight loop with such full CPU utilization. I remember this from a non-SNMP
> project, but select is used everywhere.
>
>
>
> Larry Dickson
>
>
>
> On 3/25/08, *Siva Prakash Reddy G* <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
>             When I'm performing SNMP walk operation, CPU idle time is
> showing 0% that means maximum CPU utilization is taken SNMP, this is
> happening only in my mib. When I did same operation on host-resource mib or
> system mib or any other which provided by net-SNMP source coders, CPU idle
> time is showing 88% or 90%, but I'm performing SNMP walk on mib CPU idle
> time is showing 0% I don't know  why this happening.
>
>
>
> If any body knows the solution for this problem, I will be thankful, if
> they share. At least if any body can list it out the reason for the problem,
> and then I will look into it.
>
>
>
>
>
>
>
>        With Regards,
>
> G. Siva Prakash Reddy.
>
>
>
> This email message and its attachments may contain CONFIDENTIAL AND
> PRIVILEGED INFORMATION intended for the sole use of the addressee(s). If you
> have received it in error, please contact the sender by return email, notify
> your system manager and destroy the original message and any copies thereof.
> Any review, use, disclosure or distribution is unlawful. Please check this
> email and any attachments for the presence of viruses. The Company accepts
> no liability for any damage caused by any virus transmitted by this email.
> The views or opinions presented in this e-mail are solely those of the
> author and do not necessarily represent those of the company.
> The Company reserves the right to monitor, review and store the content of
> all messages sent to or from this e-mail address.
>
> www.aztecsoft.com
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
>
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Net-snmp-coders mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>
>
>   This email message and its attachments may contain CONFIDENTIAL AND
> PRIVILEGED INFORMATION intended for the sole use of the addressee(s). If you
> have received it in error, please contact the sender by return email, notify
> your system manager and destroy the original message and any copies thereof.
> Any review, use, disclosure or distribution is unlawful. Please check this
> email and any attachments for the presence of viruses. The Company accepts
> no liability for any damage caused by any virus transmitted by this email.
> The views or opinions presented in this e-mail are solely those of the
> author and do not necessarily represent those of the company.
> The Company reserves the right to monitor, review and store the content of
> all messages sent to or from this e-mail address.
>
> www.aztecsoft.com
>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to