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


Groups > comp.lang.python > #88250

Run two processes in parallel

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 195.154.70.45
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!proxad.net!feeder1-2.proxad.net!nntpfeed.proxad.net!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'concurrently': 0.07; 'pypi': 0.07; 'subject:two': 0.07; 'builtin': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '(either': 0.16; 'background,': 0.16; 'concurrent': 0.16; 'displaying': 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; 'suggest?': 0.16; 'wrong).': 0.16; 'module': 0.19; 'import': 0.22; 'header:User- Agent:1': 0.23; 'task': 0.26; 'second': 0.26; '(for': 0.26; 'header:X-Complaints-To:1': 0.27; 'skip:p 30': 0.29; 'see,': 0.30; 'run': 0.32; "i'd": 0.34; 'could': 0.34; 'charset:us-ascii': 0.36; 'hi,': 0.36; 'should': 0.36; 'too': 0.37; 'two': 0.37; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'first': 0.61; 'received:93': 0.72; 'suited': 0.93; 'technique': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Thorsten Kampe <thorsten@thorstenkampe.de>
Subject Run two processes in parallel
Date Sun, 29 Mar 2015 10:11:47 +0200
Mime-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host p5de5a626.dip0.t-ipconnect.de
User-Agent MicroPlanet-Gravity/3.0.4
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.19
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.301.1427617205.10327.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1427617205 news.xs4all.nl 2834 [2001:888:2000:d::a6]:37975
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:88250

Show key headers only | View raw


Hi,

I'd like to run two processes concurrently (either through a builtin 
module or a third-party). One is a "background" task and the other is 
displaying a spinner (for which I already found good packages).

The two processes do not have to communicate with each other; only 
the second should be able to know when the first has terminated. To 
make it clear, this is the pseudo-code:

```
import time, PARALLEL, spinner
process1 = PARALLEL.start(time.sleep(60))

while process1.isrunning
    spinner.update()
    time.sleep(1)

print('done')
```

>From what I see, Python modules threading and multiprocessing seem 
either not suited for that or to be too complicated (though I don't 
have any experience with these and could be wrong). A search on PyPi 
for parallel, background, and concurrent found too many.

What would you do? Which technique or module would you suggest?

Thorsten

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


Thread

Run two processes in parallel Thorsten Kampe <thorsten@thorstenkampe.de> - 2015-03-29 10:11 +0200

csiph-web