Running a python program during idle time only

Asbjørn Sæbø asbjs at stud.ntnu.no
Tue May 24 02:27:32 EDT 2005


"los" <carlos80 at gmail.com> writes:

> Thanks for all the replies.
> 
> I did try using nice under windows.  I created a java program that
> would just loop and print numbers on the screen.  Even when I ran that
> simple program with nice, (lets call it program A) as soon as I started
> the program the cpu went all the way to 100% usage.  Then when I ran
> another program that did the same thing (lets call it program B),
> program A halted to let B finish, then it started again.  Nevertheless
> it still hogged all the cpu while I was using the computer.

Well, shouldn't it?  You don't want to waste CPU cycles.  If   your
program is niced to a low priority, it will run _only when more
important tasks doesn't run_.  I.e.: It stays out of the way when
higher priority processes claim the computer, while still utilizing
the rest of the computational power.

My experience is that properly niced processes can use almost 100
percent CPU, and still not have any noticeable effect on my other use
of the computer.

Asbj.S.
-- 
Asbjørn Sæbø, post.doc. 
Centre for Quantifiable Quality of Service in Communication Systems
Norwegian University of Science and Technology
<URL: http://www.q2s.ntnu.no/ >



More information about the Python-list mailing list