GIL in the new glossary

David Mertz mertz at gnosis.cx
Fri Oct 3 12:58:56 EDT 2003


lcaamano at mindspring.com (Luis P Caamano) wrote previously:
|> > a) play with IPC again
|> Sounds like a great idea to me.  :-)

|Not if you need several hundred threads in your app.

You don't NEED hundreds of threads in your app.  You have decided to
implement your app using hundreds of threads; which might be fine, but
it certainly not the ONLY possibility (even without knowing what your
app is).  Threads are NEVER "the only way."

For example, using "weightless threads" has much less overhead than does
PThreads, if you really need hundreds (or at least if you need thousands),
see <http://gnosis.cx/publish/programming/charming_python_b7.html>.

In any case, there is no reason why threading and IPC cannot combine.
One process (for one processor) can itself run as many threads as it
wants, and IPC can communicate data between each hundred-thread process.
Problem solved... at the cost of requiring a bit of lumpiness in the
division of computation.

Given that massively parallel machines are EXPENSIVE, and that
applications that need them are RARE, it hardly seems like an unbearable
burden for programmers of such apps to put in a SMALL amount of extra
work using an IPC framework.  I doubt that Python developers will ever
invest the much larger amount of work that would be needed for a free
threading interpreter... but you are welcome to, of course.

As someone else commented, Caamano seems to want PThreads more as a
matter of religious dogma than out of any concrete benefits.  That's the
wrong approach, to my mind, for implementing any application... but even
more so for computationally expensive ones.

|see how it would compare to the same app written in
|C running on an OS with an MxN pthread library.  :-)

Yep. C is faster than Python.  Given the rest of Caamano's doctrine
that his apps must be written in Python, that seems irrelevant though.

Yours, David...

--
    _/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY: Postmodern Enterprises _/_/_/
   _/_/    ~~~~~~~~~~~~~~~~~~~~[mertz at gnosis.cx]~~~~~~~~~~~~~~~~~~~~~  _/_/
  _/_/  The opinions expressed here must be those of my employer...   _/_/
 _/_/_/_/_/_/_/_/_/_/ Surely you don't think that *I* believe them!  _/_/






More information about the Python-list mailing list