File Polling (Rereading)

Peter Hansen peter at engcorp.com
Thu Oct 21 12:19:32 EDT 2004


Daniel Mueller wrote:
> Peter Hansen wrote:
>> Why?  Do you have any evidence that you have a performance problem
> 
> Yeah i know that /proc is a virtual filesystem. And yes i know that the 
> files always have the pressent timestamp.

Then we can at least dispense with any kind of "read changes only"
concept, can't we?  You clearly have to read the entire file and
compare it with the previous file to know exactly what has changed.
Or read the file and parse it and compare the parsed results.  I'm
unclear what other approach could be conceived of...

> Well the application uses up to 10% of CPU power with every poll... is 
> that a normal amount??

Sure... actually I wouldn't be surprised if my program appeared
to take 100% of CPU while processing the data after reading the
files...  to do otherwise would be abnormal.  What I'd be focusing
on, however, was for *how long* it did so.

-Peter



More information about the Python-list mailing list