os.stat bug?

Laszlo Nagy gandalf at shopzeus.com
Mon Mar 21 06:12:06 EDT 2011


On 2011-03-21 10:58, Martin v. Loewis wrote:
>> Could it be a problem with the operation system? Is it possible that an
>> os.stat call requires 100% CPU power from the OS? Or is it a problem
>> with the Python implementation?
> There is a chance that the CPU usage actually comes from the thread
> doing sleep(). If you have a very short sleep time, and a loop around
> it, it may spin in this loop.
Sleep time is 1.0 sec.
> If it's not that, and if it's not any other unrelated application that
> uses CPU that you didn't mention, then chances are high that it's indeed
> the file system code of your operating system that consumes that much
> CPU time.
Yes. top shows 2 thread in this process, and full 100% CPU time is 
dedicated to the process. So it must be it.

Thank you,

    Laszlo




More information about the Python-list mailing list