Re: Python un-plugging the Interpreter



"Jorgen Grahn" <grahn+nntp@xxxxxxxxxxxxxxxxxxxxxx> wrote:


On Wed, 25 Apr 2007 08:05:01 +0200, Hendrik van Rooyen <mail@xxxxxxxxxxxxxxx>
wrote:
"Jorgen Grahn" <grahn+nntp@xxxxxxxxxxxxxxxxxxxxxx> wrote:
...
I doubt it. (But I admit that I am a bit negative towards thread
programming in general, and I have whined about this before.)


I find this last statement interesting, because it differs so much
from my own attitude - getting a thread running was one of the
first things I did when I started getting to grips with python.

Do you mind "whining" some more - maybe I can learn
something - threads seem to me to make a lot of things so
much easier and more natural, as I see them as sequences
that run "at the same time", and I find this immensely useful
for all sorts of things, as it enables me to think in a simple
linear fashion about parts of complicated things.

It's the other way around for me -- using a threaded design looks
superficially more linear, but all the complexity is still there, and
then some. I mean, threads are well known for causing surprising and
hard-to-track-down (and hard to trigger!) bugs and performance
problems.

(I'm comparing with the Unix select() call, and I assume the APIs I
want to use are designed to work with select(). i.e. use select()able
file descriptors.)

This is a valuable insight - it is to a large extent true that threading is
used to "front end" i/o - but that is not its only use...

I tend to use it to build, via Queue glue, structures that resemble
systolic arrays - where each thread does a small part of a whole job.


And if you
add queues, you have something in your hand that you can
do quite fancy stuff with in a robust, simple manner...

*grin* before I discovered the queue module, I was using
named pipes to communicate between threads...

So you could say I am a threading freak if you want to, and
I won't argue.

But I would like to hear the opposite viewpoint..

Good. My viewpoint is due to my Unix background (but I'm not
insinuating that all Unix users dislike threads).

Eric Raymond's "The Art of Unix Programming" sums up the threading
criticism, I think:

http://catb.org/~esr/writings/taoup/html/multiprogramchapter.html

/Jorgen

Thanks - interesting link. This guy really is not turned on by threading...

- Hendrik

.



Relevant Pages

  • Re: Python un-plugging the Interpreter
    ... *grin* before I discovered the queue module, ... But I would like to hear the opposite viewpoint.. ... My viewpoint is due to my Unix background (but I'm not ... Eric Raymond's "The Art of Unix Programming" sums up the threading ...
    (comp.lang.python)
  • Review: Art of Unix Programming by Eric S. Raymond
    ... The Art of Unix Programming ... "Eric S. Raymond (or ESR) is widely known for the groundbreaking ... In interface design, ...
    (comp.unix.programmer)
  • Re: next the good jobs will go
    ... I thought Unix was designed for telephone switching networks and its ... trial and error isn't part of its design and implementation. ... programmers coming from if structure programming isn't taught. ... grabbed by many universities to support their research - essentially it ...
    (soc.retirement)
  • Re: Microsoft to release patch for IE flaw
    ... Stick with Apple or Microsoft because they, not the Unix crowd, ran IBM out of the PC business. ... I programmed a little in APL on a 5110. ... As I recall, Dijkdtra was a programmer, most noted for structured, top down programming and minimum instruction set. ... His more recent work was in the field of multi-processing including the development of fundamental algorithms and methods for interactions between operating systems that run concurrently on multiple machines. ...
    (soc.retirement)
  • Re: Microsoft to release patch for IE flaw
    ... Stick with Apple or Microsoft because they, not the Unix crowd, ran IBM out of the PC business. ... I programmed a little in APL on a 5110. ... As I recall, Dijkdtra was a programmer, most noted for structured, top down programming and minimum instruction set. ... His more recent work was in the field of multi-processing including the development of fundamental algorithms and methods for interactions between operating systems that run concurrently on multiple machines. ...
    (soc.retirement)