Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.049 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'compute': 0.09; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:edu.au': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'simpson': 0.16; 'subject:bound': 0.16; 'threads': 0.16; 'wrote:': 0.17; 'do.': 0.21; 'suddenly': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'trouble': 0.28; 'cpu': 0.29; 'i/o': 0.29; 'surprised': 0.29; "i'm": 0.29; 'directory,': 0.33; 'handle': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'doing': 0.35; 'sometimes': 0.35; 'subject:?': 0.35; 'something': 0.35; 'add': 0.36; 'but': 0.36; 'received:au': 0.36; 'charset:us- ascii': 0.36; 'does': 0.37; 'detail': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'content- disposition:inline': 0.60; 'skip:u 10': 0.60; 'bring': 0.62; 'email addr:gmail.com': 0.63; 'more': 0.63; 'become': 0.65; 'jobs': 0.65; 'overall': 0.66; 'talking': 0.66; 'soon': 0.70; '100%': 0.76; '(they': 0.84; 'drops': 0.91 Date: Sun, 3 Mar 2013 17:27:56 +1100 From: Cameron Simpson To: python-list@python.org Subject: Re: RLock IO bound? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43fc67b0-5846-4aad-8563-dbb3fad2caaa@googlegroups.com> User-Agent: Mutt/1.5.21 (2010-09-15) References: <43fc67b0-5846-4aad-8563-dbb3fad2caaa@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362292089 news.xs4all.nl 6951 [2001:888:2000:d::a6]:46583 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40402 On 02Mar2013 17:35, juancarlo.anez@gmail.com wrote: | I have a set of processes that bring any number of cores to 100% | use when unsynchronized (they take independent jobs from a queue). | | As soon as I add an RLock to handle shared access to a file-system | directory, the CPU utilization drops to 60%. | | I'm not talking about overall speed here, but about processes | that were CPU bound and suddenly become bound to something else | with RLock. Shrug. If your threads do some I/O and now block where they would have overlapped then suddenly your threads can't do compute all the time. Ergo, less CPU utilisation. Without more detail nobody can say where your particular bottleneck lies, but I would be very very surprised if the RLock was the bottleneck; what you're doing _inside_ the RLock is the bottleneck. -- Cameron Simpson My computer always does exactly what I tell it to do but sometimes I have trouble finding out what it was that I told it to do. - Dick Wexelblat