Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder1.xlned.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:module': 0.04; 'deprecated': 0.09; 'call?': 0.16; 'docs,': 0.16; 'parallel,': 0.16; 'stderr': 0.16; 'stdout': 0.16; 'subject:skip:s 10': 0.18; 'seems': 0.20; 'trying': 0.21; 'header:In-Reply-To:1': 0.22; 'thanks.': 0.26; "i'm": 0.27; 'all,': 0.28; 'module': 0.30; 'threads': 0.30; 'to:addr:python-list': 0.33; 'file.': 0.34; 'external': 0.35; 'charset:us-ascii': 0.36; 'question': 0.36; 'thread': 0.37; 'perform': 0.37; 'using': 0.37; 'but': 0.37; 'not,': 0.38; 'some': 0.38; 'should': 0.38; 'to:addr:python.org': 0.39; 'database.': 0.74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=dannwong@cisco.com; l=475; q=dns/txt; s=iport; t=1312958348; x=1314167948; h=mime-version:content-transfer-encoding:subject:date: message-id:in-reply-to:references:from:to; bh=Uvv89pWsCijgGkPl6UIicEy7xNhuhrrll1jvphrVXfQ=; b=Z4bCmBuvtO89FKOG9rMei8xmEa7ctOYty42nsZb2gxkWnP8JlatMwQcI xh2bzH6p6OWpea4EJMerSGQOz+C+O+uNpr0HYnhKnhz7Sz3pe4vXzSHYr d+Bv1+9LJ2kXUQRyhmBR7iUsctzjxCGHN9zY0BhhvTpBoI2bfIZS9X8vr w=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AroGALQmQk6tJV2a/2dsb2JhbABBmCqPHHeBQQEBAQMSAR0KTwIBKgYYBgFWAQEEGxqnEwGeQ4VnXwSHXZA/i3g X-IronPort-AV: E=Sophos;i="4.67,349,1309737600"; d="scan'208";a="11624534" X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: subprocess.Popen and thread module Date: Wed, 10 Aug 2011 01:38:56 -0500 In-Reply-To: <20110808013500.7c9e30ff44caee0f0bbf988a@johnohagan.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: subprocess.Popen and thread module Thread-Index: AcxXKC3b6ZJXuBakSGW7t+iz1pc1zw== References: <20110808013500.7c9e30ff44caee0f0bbf988a@johnohagan.com> From: "Danny Wong (dannwong)" To: X-OriginalArrivalTime: 10 Aug 2011 06:39:00.0693 (UTC) FILETIME=[30435850:01CC5728] X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1312958350 news.xs4all.nl 23871 [2001:888:2000:d::a6]:45897 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11095 Hi All, I'm trying to execute some external commands from multiple database. I'm using threads and subprocess.Popen ( from docs, all the popen* functions are deprecated and I was told to use subprocess.Popen) to execute the external commands in parallel, but the commands seems to hang.=20 My question is: Is subprocess.Popen thread safe? If not, what other module should I use to perform a system call? I also, want to log stdout and stderr to a file. Thanks.