threading

Marko Rauhamaa marko at pacujo.net
Thu Apr 10 15:44:01 EDT 2014


Rustom Mody <rustompmody at gmail.com>:

> Marco (and evidently Chris) are in the CP camp whereas Sturla is in
> the PP camp. Its just the 'data-structures (and algorithms)' is now
> replaced by 'concurrency'
>
> Both these viewpoints assume that the status quo of current
> (mainstream) language support for concurrency is a given and not
> negotiable.

I think you misread me (us?). I'm not trying to make life hard on
myself. Nor am I disparaging fitting abstractions and high-level
utilities.

Threads are an essential tool when used appropriately. However, I do
believe the 90's fad of treating them like a silver bullet of
concurrency was a big mistake. The industry is noticing it, as is
evident in NIO and asyncio.

Threads are enticing in that they make it quick to put together working
prototypes. The difficulties only appear when it's too late to go back.
They definitely are not the high-level abstraction you're looking for.

> Erlang/Go etc disprove this.

<URL: http://en.wikipedia.org/wiki/Leonhard_Euler#
Personal_philosophy_and_religious_beliefs>:

                  n
             a + b
        Sir, ------ = x, hence God exists—reply!
               n

Seriously, Erlang (and Go) have nice tools for managing state machines
and concurrency. However, Python (and C) are perfectly suitable for
clear asynchronous programming idioms. I'm happy that asyncio is
happening after all these long years. It would be nice if it supported
edge-triggered wakeups, but I suppose that isn't supported in all
operating systems.


Marko



More information about the Python-list mailing list