Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > subprocess.Popen and thread module

Reply
Thread Tools

subprocess.Popen and thread module

 
 
Danny Wong (dannwong)
Guest
Posts: n/a
 
      08-10-2011
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.
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.
 
Reply With Quote
 
 
 
 
Thomas Rachel
Guest
Posts: n/a
 
      08-10-2011
Am 10.08.2011 08:38 schrieb Danny Wong (dannwong):
> 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.
> My question is:
> Is subprocess.Popen thread safe?


Do you really need threads here? As you just run those external commands
(as far as I understand), it might be enough to start the commands, hold
their object, read them out (maybe part for part) and then wait().


Thomas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
releasing callback thread immediately by enqueuing it and processingit on another thread. bsobaid C++ 1 04-06-2009 08:00 PM
Thread limit and thread stack size blair.bethwaite@gmail.com Python 0 11-26-2008 12:26 AM
boost.thread library and the thread is running Miroslaw Makowiecki C++ 1 08-09-2007 07:14 PM
Re: module docstring, documentation,anything? please note is the module type/object NOT some module Maric Michaud Python 0 06-24-2006 12:42 PM
What is the difference between Thread.sleep(10) and Thread.currentThread().sleep(10) ? Gonzalo Moreno Java 2 04-05-2004 05:41 PM



Advertisments