Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30309

Re: How to limit CPU usage in Python

References <mailman.960.1348154419.27098.python-list@python.org> <7xpq5d7j5e.fsf@ruckus.brouhaha.com> <5B80DD153D7D744689F57F4FB69AF474166CAA91@SCACMX008.exchad.jpmchase.net>
Date 2012-09-27 13:07 -0400
Subject Re: How to limit CPU usage in Python
From Jerry Hill <malaclypse2@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1499.1348765679.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Sep 27, 2012 at 12:58 PM, Prasad, Ramit
<ramit.prasad@jpmorgan.com> wrote:
> On *nix you should just set the appropriate nice-ness and then
> let the OS handle CPU scheduling. Not sure what you would do
> for Windows--I assume OS X is the same as *nix for this context.

On windows, you can also set the priority of a process, though it's a
little different from the *nix niceness level.  See
http://code.activestate.com/recipes/496767/ for a recipe using
pywin32.  I believe the psutil module handles this too, but I don't
think it manages to abstract away the platform differences.

-- 
Jerry

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

How to limit CPU usage in Python Rolando Cañer Roblejo <rolando.caner@cnic.edu.cu> - 2012-09-20 11:12 -0400
  Re: How to limit CPU usage in Python Tim Roberts <timr@probo.com> - 2012-09-22 13:55 -0700
    Re: How to limit CPU usage in Python Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-22 23:24 -0400
  Re: How to limit CPU usage in Python Paul Rubin <no.email@nospam.invalid> - 2012-09-22 16:05 -0700
    Re: How to limit CPU usage in Python Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-22 23:04 -0400
    Re: How to limit CPU usage in Python Tim Roberts <timr@probo.com> - 2012-09-24 21:09 -0700
    RE: How to limit CPU usage in Python "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-09-27 16:58 +0000
    Re: How to limit CPU usage in Python Jerry Hill <malaclypse2@gmail.com> - 2012-09-27 13:07 -0400

csiph-web