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


Groups > comp.lang.python > #61680

Re: Threading In Python

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <marcinmltd@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.094
X-Spam-Evidence '*H*': 0.81; '*S*': 0.00; 'interpreter': 0.05; 'subject:Python': 0.06; 'concurrently': 0.07; 'advance': 0.07; '--------': 0.10; 'python': 0.11; 'machine?': 0.16; 'email addr:gmail.com&gt;': 0.22; 'python?': 0.22; 'closely': 0.24; 'module,': 0.24; 'guys': 0.24; 'looks': 0.24; 'help!': 0.26; 'switch': 0.26; 'to:2**1': 0.27; 'to:no real name:2**1': 0.29; "i'm": 0.30; 'run': 0.32; 'date:': 0.34; 'message.': 0.35; 'advice': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'thanks': 0.36; 'two': 0.37; 'list': 0.37; 'email addr:python.org': 0.37; 'received:10': 0.37; 'tasks': 0.38; 'to:addr:python-list': 0.38; 'subject:': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'experts': 0.60; 'hope': 0.61; 'received:10.1': 0.61; 'subject: ': 0.61; 'more': 0.64; 'email name:python-list': 0.65; 'to:addr:gmail.com': 0.65; 'between': 0.67; 'header:Reply-To:1': 0.67; 'subject': 0.69; 'reply-to:addr:gmail.com': 0.80; 'protects': 0.84; 'samsung': 0.84; 'browsing': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:subject:message-id:importance:from:to:reply-to:mime-version :content-type; bh=Blaq4OVxLpjOr9sanajcGjIP2fj10T9rqwYVVVi7J74=; b=nnk9/hJ6r4Cht8CZk5FJ316JppCn8OHCKkzhIGMMwmDyYpaMFBRRmZfF/dvQThPsQL UA/7CkSeWETBSzpDCmXVbEPuFMH7usRA/r1tnqgnk8+zWPy5WVy/Kp0v/xiNgIMfb7HV BI/77Xh33qRBPbCnMRxV6Ltx7ak34pCxlnWwvQlWEec722jhXM6+uAeP99PRraXSz+lT J9+FeWUVDMFMvKwL+2y1xBQJsepbUDUy9HZkOPQuJnAVj1TpNHXwQ2UOPJ+JFZ9Y3iSA S96ikGYziVRUqCGoyhzPfmQNoueSir7GE+mzZ8EnoRQ7wzFHsz+TcWZnECSk0dgiKqGs 7sUQ==
X-Received by 10.205.88.201 with SMTP id bb9mr76685bkc.128.1386835714368; Thu, 12 Dec 2013 00:08:34 -0800 (PST)
Date Thu, 12 Dec 2013 08:08:26 +0000
Subject Re: Threading In Python
Importance normal
From marcinmltd <marcinmltd@gmail.com>
To marcinmltd@gmail.com, python-list@python.org
MIME-Version 1.0
Content-Type multipart/alternative; boundary="--_com.android.email_121357073348600"
X-Mailman-Approved-At Thu, 12 Dec 2013 09:27:59 +0100
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To marcinmltd <marcinmltd@gmail.com>
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.3972.1386836880.18130.python-list@python.org> (permalink)
Lines 53
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1386836880 news.xs4all.nl 2953 [2001:888:2000:d::a6]:42474
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:61680

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Adding subject to the message.




Sent from Samsung Mobile on O2

-------- Original message --------
From: marcinmltd <marcinmltd@gmail.com> 
Date:  
To: python-list@python.org 
Subject:  
 
Hello,

I'm big fan of multiprocessing module, but recently I started looking at threading in Python more closely and got couple of questions I hope You can help me with:

1. When I run two or more threads in my python process are they really run concurrently on mulicore machine?

2. Browsing through documentation it looks like python interpreter protects its sensitive states by using GIL. Can you guys list situations when this happens?

2. What would be general advice from python experts on when to use threadng and when switch to multliprocessing in python? Is the decision still influenced by how often we need to comunicate between the tasks as it's in C\C++?

thanks in advance for help!
Marcin


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


Thread

Re: Threading In  Python marcinmltd <marcinmltd@gmail.com> - 2013-12-12 08:08 +0000

csiph-web