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


Groups > comp.lang.python > #36799

Re: Thought of the day

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!usenet-fr.net!nerim.net!novso.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'languages,': 0.04; 'apis': 0.07; 'suppose': 0.07; 'python': 0.09; '(default': 0.09; 'interpreter,': 0.09; 'threads,': 0.09; 'language,': 0.11; 'programmer': 0.11; 'language': 0.14; '+1.': 0.16; 'agree.': 0.16; 'concurrency': 0.16; 'gil,': 0.16; 'non- trivial': 0.16; 'on)': 0.16; 'stepping': 0.16; 'threading': 0.16; 'threads': 0.16; 'usage,': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'jan': 0.18; '>>>': 0.18; 'memory': 0.18; '(or': 0.18; 'windows': 0.19; 'putting': 0.20; 'either.': 0.22; 'extends': 0.22; 'runs': 0.22; 'apps': 0.23; "python's": 0.23; "i've": 0.23; 'feature': 0.24; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'am,': 0.27; 'structures': 0.27; "doesn't": 0.28; '3.1': 0.29; 'cases.': 0.29; "d'aprano": 0.29; 'dan': 0.29; 'gil': 0.29; 'invoke': 0.29; 'steven': 0.29; 'objects': 0.29; 'probably': 0.29; "we're": 0.30; 'figure': 0.30; 'code': 0.31; 'running': 0.32; 'getting': 0.33; 'instead,': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; "can't": 0.34; 'project': 0.34; 'done': 0.34; 'needed': 0.35; 'mine': 0.35; 'problem,': 0.35; 'pm,': 0.35; 'too.': 0.35; 'something': 0.35; 'except': 0.36; 'tool': 0.36; 'but': 0.36; "didn't": 0.36; "i'll": 0.36; 'too': 0.36; 'possible': 0.37; 'level': 0.37; 'two': 0.37; 'moment': 0.37; 'virtual': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'step': 0.39; 'received:192': 0.39; 'application': 0.40; 'where': 0.40; 'received:192.168': 0.40; 'end': 0.40; 'think': 0.40; 'matter': 0.61; 'policy': 0.62; 'solve': 0.62; 'provide': 0.62; 'ever': 0.63; 'more': 0.63; 'other.': 0.64; 'levels': 0.66; 'subject:day': 0.66; 'header :Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'heavy': 0.83; 'low': 0.83; '2013': 0.84; "it'd": 0.84; 'much,': 0.84; 'shared,': 0.84; 'tolerance': 0.84; 'lately,': 0.91; 'promised': 0.91; 'same,': 0.91; 'angel': 0.93
Date Mon, 14 Jan 2013 12:12:54 -0500
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: Thought of the day
References <50f3869d$0$29983$c3e8da3$5496439d@news.astraweb.com> <mailman.492.1358155623.2939.python-list@python.org> <nRUIs.51167$On7.15414@newsfe16.iad>
In-Reply-To <nRUIs.51167$On7.15414@newsfe16.iad>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:mv9ZWkAkHxZsRciOhbLM+A1k3MjtvoiLk6ASgF6JtZO OeeUWeLI8KDuO3RNHXhOI18V0GL2hlAM47SjM4M9BGy37rHW2j xukBrCTtHcw33CWAfyaTQaoPBavX0vbj4Cr4in8CxsbzVlBocL i2vWA7YWqGk2AiF41NncxHL3S30gRELn+klf/toEcIJVIG1N2b mJRatfpcCjDDWkIRFEVSS0ByYWHa9sj2xblxxfeptMtxVSkVbm fQg6AbY38yvqAJ1qay1z8xGaUSo5K+0zvTJRUBuLBKInGjAGgn nwRN8gNOKNnIGtqP9gcHkdolYyclRiIH4faQzt4ebEVdgkngQ= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To d@davea.name
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.505.1358183593.2939.python-list@python.org> (permalink)
Lines 53
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1358183593 news.xs4all.nl 6880 [2001:888:2000:d::a6]:53595
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36799

Show key headers only | View raw


On 01/14/2013 09:44 AM, Dan Sommers wrote:
> On Mon, 14 Jan 2013 00:31:59 -0500, Dave Angel wrote:
>
>> On 01/13/2013 11:16 PM, Steven D'Aprano wrote:
>>> A programmer had a problem, and thought Now he has "I know, I'll solve
>>> two it with threads!" problems.
>> ++10
> It took me a moment to figure it out, but in the end I smiled and I 
> agree:  +1.
>
>> I've been thinking about threads lately, and have come to the tentative
>> conclusion that they're a solution which has outlived its usefulness for
>> 99% of the use cases.  Much like the Windows 3.1 model of memory usage,
>> where all memory was shared, and apps promised not to step too hard on
>> each other.  Or the "640k is more memory than any application will ever
>> need" notion.
> With this, however, I don't agree.  If Python's GIL didn't interfere with 
> the concurrency of threads,

Better minds than mine have tried very hard to eliminate the GIL, so for
now I consider that a feature of Python.  If the GIL weren't needed for
the lowest levels of the interpreter, something else would be needed for
all the possible data structures that need atomic updates.  Hello
semaphores, mutexes, etc.  If threading were considered important in a
language, it'd have a way to declare an object sharable (default off),
and the low level code would go at full speed for any object not so
declared.  But the language would then provide guarantees for the
standard objects that are marked as sharable.  That's not current Python.

>  I can't think of a good reason to use 
> multiple processes instead, except to use a tool that runs outside the 
> Python virtual machine, or to provide more fault tolerance for long-
> running server-like applications.  We're all adults here, and if the 
> policy is to invoke the methods of objects as documented, then that 
> policy extends to stepping on (or not stepping on) the memory of other 
> threads, too.
>
> The APIs for threads and processes is pretty much the same, so I suppose 
> it doesn't matter much, either.  Use the right tool for the job.
>
> Dan

For other languages, I've done extensive work on projects with heavy
multithreading, and getting it right is extremely difficult.  Another
way of putting it is that any non-trivial project with multithreading is
probably buggy. 



-- 

DaveA

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


Thread

Thought of the day Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-14 04:16 +0000
  Re: Thought of the day Dave Angel <d@davea.name> - 2013-01-14 00:31 -0500
    Re: Thought of the day Dan Sommers <dan@tombstonezero.net> - 2013-01-14 14:44 +0000
      Re: Thought of the day Dave Angel <d@davea.name> - 2013-01-14 12:12 -0500
  Re: Thought of the day alex23 <wuwei23@gmail.com> - 2013-01-14 04:09 -0800
  Re: Thought of the day Tim Chase <python.list@tim.thechases.com> - 2013-01-14 08:15 -0600
  Re: Thought of the day Chris Angelico <rosuav@gmail.com> - 2013-01-15 01:18 +1100
  Re: Thought of the day Grant Edwards <invalid@invalid.invalid> - 2013-01-14 15:08 +0000
  Re: Thought of the day Michael Torrie <torriem@gmail.com> - 2013-01-14 10:37 -0700
    Re: Thought of the day John Gordon <gordon@panix.com> - 2013-01-14 18:09 +0000
      Re: Thought of the day Michael Torrie <torriem@gmail.com> - 2013-01-14 11:25 -0700
  Re: Thought of the day Dave Angel <d@davea.name> - 2013-01-14 09:31 -0500
  Re: Thought of the day Antoine Pitrou <solipsis@pitrou.net> - 2013-01-15 16:48 +0000
    Re: Thought of the day DJC <djc@news.invalid> - 2013-01-15 22:54 +0000
  Re: Thought of the day Tim Golden <mail@timgolden.me.uk> - 2013-01-15 16:59 +0000
  Re: Thought of the day Chris Angelico <rosuav@gmail.com> - 2013-01-16 07:27 +1100
  Re: Thought of the day John Ladasky <john_ladasky@sbcglobal.net> - 2013-01-16 23:26 -0800

csiph-web