Re: CPU spikes when migrating proprietary code from AS 2.1 to AS 3.0
From: David Schwartz (davids_at_webmaster.com)
Date: 12/24/04
- Previous message: Larry I Smith: "Re: Problem in using compiling C++ project"
- In reply to: Sean Kirkpatrick: "CPU spikes when migrating proprietary code from AS 2.1 to AS 3.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 23 Dec 2004 21:59:21 -0800
"Sean Kirkpatrick" <sean.kirkpatrick@pipelinetrading.com> wrote in message
news:1103829014.288911.225510@z14g2000cwz.googlegroups.com...
> The attached program demonstrates the problem. It can be run as a
> daemon (default) or non-daemon (cmd opt -no-daemon). It will stat a
> non existent file 100 times every 10 milliseconds, using select to
> sleep. (I have also tried using nanosleep with the same results.) When
> run on the 2.4.21 SMP kernels it will quickly begin to accumulate CPU
> time, caused by these intermittent spikes as opposed to a steady
> build-up. When run on the 2.4.9 SMP kernel or the 2.4.21 NON - SMP
> kernel, there are no cpu spikes, and no accumulation of CPU time.
You *cannot* use 'select' for this purpose. Read the POSIX definition of
'select' carefully, and you will see that it is perfectly legal for 'select'
to be a no-operation when used this way. On the other hand, 'nanoleep' is
*required* to sleep for at least the amount of time you specified, but bugs
occasionaly cause it to not do so. My bet is that an increase in the
scheduling rate has caused your 10 millisecond sleep to no longer be
appropriate.
DS
- Previous message: Larry I Smith: "Re: Problem in using compiling C++ project"
- In reply to: Sean Kirkpatrick: "CPU spikes when migrating proprietary code from AS 2.1 to AS 3.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|