P
Paul Rubin
km said:is true parallelism possible in python ? or atleast in the coming versions ?
is global interpreter lock a bane in this context ?
http://poshmodule.sf.net
km said:is true parallelism possible in python ? or atleast in the coming versions ?
is global interpreter lock a bane in this context ?
Paul said:
Robin Becker said:Is posh maintained? The page mentions 2003 as the last date.
is true parallelism possible in python?
or atleast in the coming versions?
is global interpreter lock a bane in this context?
km said:> Hi all,
>
> is true parallelism possible in python ? or atleast in the
> coming versions ? is global interpreter lock a bane in this
> context ?
Bryan Olson said:No; maybe; and currently, not usually.
On a uniprocessor system, the GIL is no problem. On multi-
processor/core systems, it's a big loser.
Mike Meyer said:The real problem is that the concurrency models available in currently
popular languages are still at the "goto" stage of language
development. Better models exist, have existed for decades, and are
available in a variety of languages.
is true parallelism possible in python ?
> or atleast in the coming versions ?
is global interpreter lock a bane in this context ?
Mike said:> The real problem is that the concurrency models available in currently
> popular languages are still at the "goto" stage of language
> development. Better models exist, have existed for decades, and are
> available in a variety of languages.
> It's not that these languages are for "thread-phobes", either. They
> don't lose power any more than Python looses power by not having a
> goto. They languages haven't taken off for reasons unrelated to the
> threading model(*).
>
> The rule I follow in choosing my tools is "Use the least complex tool
> that will get the job done."
> Given that the threading models in
> popular languages are complex and hard to work with, I look elsewhere
> for solutions. I've had good luck using async I/O in lieue of
> theards. It's won't solve every problem, but where it does, it's much
> simpler to work with.
The real problem is that the concurrency models available in currently
popular languages are still at the "goto" stage of language
development. Better models exist, have existed for decades, and are
available in a variety of languages.
Donn Cave said:Quoth Paul Rubin <http://[email protected]>:
|> The real problem is that the concurrency models available in currently
|> popular languages are still at the "goto" stage of language
|> development. Better models exist, have existed for decades, and are
|> available in a variety of languages.
| But Python's threading system is designed to be like Java's, and
| actual Java implementations seem to support concurrent threads just fine.
I don't see a contradiction here. "goto" is "just fine", too --
you can write excellent programs with goto.
Mike, care to mention an example or two of the better models you
had in mind there?
Bryan Olson said:That's not "the real problem"; it's a different and arguable
problem. The GIL isn't even part of Python's threading model;
it's part of the implementation.
Even if a more complex tool could do the job better?
Now I've gotten off-topic. Threads are winning, and the industry
is going to multiple processors even for PC-class machines.
Might as well learn to use that power.
Mike Meyer said:Even simpler to program in is the model used by Erlang. It's more CSP
than threading, though, as it doesn't have shared memory as part of
the model. But if you can use the simpler model to solve your problem
- you probably should.
The June edition of "SIGPLAN Notices" (the PLDI'05 proceeding issue)with these issues. If I ever find myself having to have non-trivial
threads again, I'll check the state of the threading models in other
languages, and make a serious push for implementing parts of the
program in a less popular language with a less primitive threading
model.
km said:is true parallelism possible in python ? or atleast in the coming versions ?
is global interpreter lock a bane in this context ?
Paul Rubin said:Well, ok, the Python equivalent would be wrapping every shareable
object in its own thread, that communicates with other threads through
Queues. This is how some Pythonistas suggest writing practically all
multi-threaded Python code. It does a reasonable job of avoiding
synchronization headaches and it's not that hard to code that way.
But I think to do it on Erlang's scale, Python needs user-level
microthreads and not just OS threads. Maybe Python 3000 can add some
language support, though an opportunity was missed when Python's
generator syntax got defined the way it did.
Dennis Lee Bieber said:The June edition of "SIGPLAN Notices" (the PLDI'05 proceeding issue)
has a paper titled "Threads Cannot Be Implemented As a Library" -- which
is primarily concerned with the problems of threading being done, well,
via an add-on library (as opposed to a native part of the language
specification: C#, Ada, Java).
I suspect Python falls into the "library" category.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.