Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed4.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'scripts': 0.03; 'nested': 0.07; 'subject:help': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'works.': 0.09; 'runs': 0.10; 'python': 0.11; 'thread': 0.14; 'code?': 0.16; 'dict': 0.16; 'dictionaries': 0.16; 'iterating': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'threads.': 0.16; 'elements': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'starts': 0.20; 'seems': 0.21; 'creating': 0.23; 'header:User-Agent:1': 0.23; 'script': 0.25; 'header:X-Complaints-To:1': 0.27; 'thus': 0.29; 'long.': 0.31; 'lists': 0.32; 'this.': 0.32; 'up.': 0.33; 'url:python': 0.33; 'mac': 0.33; 'subject:with': 0.35; 'created': 0.35; 'module.': 0.36; 'list': 0.37; 'list.': 0.37; 'to:addr :python-list': 0.38; 'resource': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'first': 0.61; 'show': 0.63; 'url:htm': 0.73; 'goal': 0.75; '80%': 0.84; 'drops': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: Please help with Threading Date: Sat, 18 May 2013 11:09:03 +0200 Organization: None References: <7baacf5a-0c50-4935-ad5b-148c208d759b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p5084af2e.dip0.t-ipconnect.de User-Agent: KNode/4.7.3 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368868155 news.xs4all.nl 15940 [2001:888:2000:d::a6]:40090 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45499 Jurgens de Bruin wrote: > This is my first script where I want to use the python threading module. I > have a large dataset which is a list of dict this can be as much as 200 > dictionaries in the list. The final goal is a histogram for each dict 16 > histograms on a page ( 4x4 ) - this already works. > What I currently do is a create a nested list [ [ {} ], [ {} ] ] each > inner list contains 16 dictionaries, thus each inner list is a single page > of 16 histograms. Iterating over the outer-list and creating the graphs > takes to long. So I would like multiple inner-list to be processes > simultaneously and creating the graphs in "parallel". > I am trying to use the python threading for this. I create 4 threads loop > over the outer-list and send a inner-list to the thread. This seems to > work if my nested lists only contains 2 elements - thus less elements than > threads. Currently the scripts runs and then seems to get hung up. I > monitor the resource on my mac and python starts off good using 80% and > when the 4-thread is created the CPU usages drops to 0%. > > My thread creating is based on the following : > http://www.tutorialspoint.com/python/python_multithreading.htm > > Any help would be create!!! Can you show us the code?