>>  You can reach a very high level of
>> parallelism with lower dead-locking probability than with java
>> threads.
>
>
> any source about that ? (any paper, benchmarks etc...)
>
Search for something like  "Guido van Rossum  threading vs forking" or
read some recent Bruce Eckel books.  The summary is that threads i.e.
a "share all, but little" are a bad approach in anything more than a
simple flow, because you end up managing a lot of possible resource
contention, and still you never know any possible state of the
application.  Better to start defining what is to be shared ("share
nothing but little") and define how to share just that.
So why threads are popular?  Because in the early '90s a very popular
O.S. was not able to support forking without killing the machine and
eating up all memory.  Java was born in that period and they took the
decision to support threads (and Java does it very well) instead of
parallel processes because of that.  Now most systems support MMU
ability to do copy on write of memory so there is no need to worry
about forks anymore.

MMAP is a way to do the sharing without resorting to different
semantics than those available with files, there are many other ways
depending on your needs.  The processing module of the standard python
library does a lot of that for you in a transparent way.  If you need
parallel processing at a higher level also across the network,
parallel python is very good at that.  In any case *stay away* from
python threading if you need really concurrent tasks.  If you expect
that they perform as in Java you will be disapponted.

mic

Reply via email to