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


Groups > comp.lang.python > #39369

Re: Exception in thread QueueFeederThread (most likely raised during interpreter shutdown)

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
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; 'exception': 0.03; 'interpreter': 0.04; 'exception.': 0.07; 'raised': 0.07; 'seemed': 0.07; 'python': 0.09; 'occasionally': 0.09; 'snippet': 0.09; 'throws': 0.09; 'used).': 0.09; 'wrong,': 0.09; 'def': 0.10; 'thread': 0.11; '"exception': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'guys,': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'subject: \n ': 0.16; 'subject:most': 0.16; 'subject:raised': 0.16; 'win7': 0.16; 'wrote:': 0.17; 'skip:p 30': 0.20; 'import': 0.21; 'skip:_ 20': 0.22; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; '(most': 0.27; '2.6': 0.27; 'module.': 0.27; 'queue': 0.29; 'skip:q 20': 0.29; 'sleep': 0.29; 'code': 0.31; 'skip:- 10': 0.32; 'could': 0.32; 'print': 0.32; 'says': 0.33; 'to:addr:python-list': 0.33; 'likely': 0.33; 'version': 0.34; 'thanks': 0.34; 'sometimes': 0.35; 'there': 0.35; 'subject: (': 0.36; 'correctly': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'google': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'end': 0.40; 'think': 0.40; 'your': 0.60; 'header:Reply-To:1': 0.68; 'race': 0.71; 'reply-to:no real name:2**0': 0.72; 'reply-to:addr:python.org': 0.84; 'subject:during': 0.84; 'x64': 0.84; 'cause,': 0.93
X-CM-Score 0.00
X-CNFS-Analysis v=2.0 cv=XeZXOvF5 c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=_vX2mLoUpDQA:10 a=FAixeVDNecsA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=R6D4UuhNE3sA:10 a=MVJihF0NlVa41E1OFywA:9 a=wPNLvfGTeEIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117
X-AUTH mrabarnett:2500
Date Wed, 20 Feb 2013 18:20:41 +0000
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130215 Thunderbird/17.0.3
MIME-Version 1.0
To python-list@python.org
Subject Re: Exception in thread QueueFeederThread (most likely raised during interpreter shutdown)
References <22cdc2c2-4851-4413-9c2c-b66f4b421b59@googlegroups.com>
In-Reply-To <22cdc2c2-4851-4413-9c2c-b66f4b421b59@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2120.1361384443.2939.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1361384443 news.xs4all.nl 6968 [2001:888:2000:d::a6]:59898
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:39369

Show key headers only | View raw


On 2013-02-20 08:26, Ziliang Chen wrote:
> Hi Guys,
> I am using the multiprocessing module. The following code snippet occasionally throws the "Exception in thread QueueFeederThread (most likely raised during interpreter shutdown)" exception.
>
> I searched google for the cause, someone says there are some issues with the multiprocessing.Queue (need do some sleep at where the queue is used).
>
> Could you please shed your light here, what is wrong, how can I use the multiprocess correctly ?
>
> Thanks very much !
>
> The python version is 2.6 and on Win7 x64 OS.
>
> ------------------
> from multiprocessing import Process,Queue
>
> def listTest(q):
>           print q.get()
>
> def queueTest():
>          q = Queue()
>          q.put([1,2,3,4,5,6])
>          p = Process(target=listTest,args=(q,))
>          p.start()
>          p.join()
>
> if __name__=='__main__':
>          queueTest()
>
> Exception in thread QueueFeederThread (most likely raised during interpreter shutdown):
>
I think it may be a race condition. When I tried it, sometimes it
failed, sometimes it didn't.

It seemed to be better behaved when I put a small sleep at the end to
delay the main process exiting.

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


Thread

Exception in thread QueueFeederThread (most likely raised during interpreter shutdown) Ziliang Chen <zlchen.ken@gmail.com> - 2013-02-20 00:26 -0800
  Re: Exception in thread QueueFeederThread (most likely raised during interpreter shutdown) MRAB <python@mrabarnett.plus.com> - 2013-02-20 18:20 +0000
    Re: Exception in thread QueueFeederThread (most likely raised during interpreter shutdown) Ziliang Chen <zlchen.ken@gmail.com> - 2013-02-21 18:30 -0800
    Re: Exception in thread QueueFeederThread (most likely raised during interpreter shutdown) Ziliang Chen <zlchen.ken@gmail.com> - 2013-02-21 18:30 -0800

csiph-web