Re: cpu usage limit

2005-05-29 Thread garabik-news-2005-05
[EMAIL PROTECTED] wrote: > I understand, that what I suggest does not solve the problem you want, > but.. > > Why do you want to restrict CPU usage to 30%? In Windows I run CPU there might be three reasons: 1) less power consumed (notebooks, PDA's) 2) less heat from CPU 3) (cross platform) schedu

Re: cpu usage limit

2005-05-27 Thread elbertlev
I understand, that what I suggest does not solve the problem you want, but.. Why do you want to restrict CPU usage to 30%? In Windows I run CPU intesive therads on IDLE priority, while interfacand/or communication threads run on normal. This gives me best of two worlds: 1. I use 100% CPU (good) an

Re: cpu usage limit

2005-05-27 Thread Peter Hansen
rbt wrote: > [EMAIL PROTECTED] wrote: >> finished = False >> while not finished: > > Why don't you just write 'while True'??? 'while not false' is like > saying 'I am not unemployed by Microsoft' instead of saying 'I am > employed by Microsoft'. It's confusing, complex and unnecessary. Lawyers

Re: cpu usage limit

2005-05-27 Thread Paul Rubin
"mmf" <[EMAIL PROTECTED]> writes: > How can I make sure that a Python process does not use more that 30% of > the CPU at any time. I only want that the process never uses more, but > I don't want the process being killed when it reaches the limit (like > it can be done with resource module). > > C

Re: cpu usage limit

2005-05-27 Thread Grant Edwards
On 2005-05-27, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> How can I make sure that a Python process does not use more that 30% of >>> the CPU at any time. I only want that the process never uses more, but >>> I don't want the process being killed when it reaches the limit (like >>> it can be

Re: cpu usage limit

2005-05-27 Thread rbt
[EMAIL PROTECTED] wrote: > rbt <[EMAIL PROTECTED]> wrote: > >>mf wrote: >> >>>Hi. >>> >>>My problem: >>>How can I make sure that a Python process does not use more that 30% of >>>the CPU at any time. I only want that the process never uses more, but >>>I don't want the process being killed when it

Re: cpu usage limit

2005-05-27 Thread Markus Franz
> Are you looping during a cpu intensive task? If so, make it sleep a bit > like this: > > for x in cpu_task: > time.sleep(0.5) > do(x) No, I don't use an intensive loop. I have about 1200 lines of code inside a process - is there nothing like xyz.setlimit(xyz.cpu, 0.30) ??? Thank. M

Re: cpu usage limit

2005-05-27 Thread garabik-news-2005-05
rbt <[EMAIL PROTECTED]> wrote: > > mf wrote: >> Hi. >> >> My problem: >> How can I make sure that a Python process does not use more that 30% of >> the CPU at any time. I only want that the process never uses more, but >> I don't want the process being killed when it reaches the limit (like >> it

Re: cpu usage limit

2005-05-27 Thread rbt
mf wrote: > Hi. > > My problem: > How can I make sure that a Python process does not use more that 30% of > the CPU at any time. I only want that the process never uses more, but > I don't want the process being killed when it reaches the limit (like > it can be done with resource module). > > C

cpu usage limit

2005-05-27 Thread mmf
Hi. My problem: How can I make sure that a Python process does not use more that 30% of the CPU at any time. I only want that the process never uses more, but I don't want the process being killed when it reaches the limit (like it can be done with resource module). Can you help me? Thanks in ad