Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > threading support in python

Reply
Thread Tools

threading support in python

 
 
km
Guest
Posts: n/a
 
      09-04-2006
Hi all,

Is there any PEP to introduce true threading features into python's
next version as in java? i mean without having GIL.
when compared to other languages, python is fun to code but i feel its
is lacking behind in threading

regards,
KM
 
Reply With Quote
 
 
 
 
bayerj
Guest
Posts: n/a
 
      09-04-2006
Hi,

GIL won't go. You might want to read
http://blog.ianbicking.org/gil-of-doom.html .

Regards,
-Justin

 
Reply With Quote
 
 
 
 
km
Guest
Posts: n/a
 
      09-04-2006
Hi all,
Are there any alternate ways of attaining true threading in python ?
if GIL doesnt go then does it mean that python is useless for
computation intensive scientific applications which are in need of
parallelization in threading context ?

regards,
KM
---------------------------------------------------------------------------
On 4 Sep 2006 07:58:00 -0700, bayerj <(E-Mail Removed)> wrote:
> Hi,
>
> GIL won't go. You might want to read
> http://blog.ianbicking.org/gil-of-doom.html .
>
> Regards,
> -Justin
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

 
Reply With Quote
 
bayerj
Guest
Posts: n/a
 
      09-04-2006
Hi,

You might want to split your calculation onto different
worker-processes.

Then you can use POSH [1] to share data and objects.
You might even want to go a step further and share the data via
Sockets/XML-RPC or something like that. That makes it easy to throw
aditional boxes at a specific calculation, because it can be set up in
about no time.
You can even use Twisted Spread [2] and its perspective broker to do
this on a higher level.

If that's not what you want, you are left with Java I guess.

Regards,
-Justin

[1] http://poshmodule.sourceforge.net/
[2] http://twistedmatrix.com/projects/co.../howto/pb.html

 
Reply With Quote
 
Sybren Stuvel
Guest
Posts: n/a
 
      09-04-2006
km enlightened us with:
> Is there any PEP to introduce true threading features into python's
> next version as in java? i mean without having GIL.


What is GIL? Except for the Dutch word for SCREAM that is...

> when compared to other languages, python is fun to code but i feel
> its is lacking behind in threading


What's wrong with the current threading? AFAIK it's directly linked to
the threading of the underlying platform.

Sybren
--
Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/
 
Reply With Quote
 
Richard Brodie
Guest
Posts: n/a
 
      09-04-2006

"km" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> if GIL doesnt go then does it mean that python is useless for
> computation intensive scientific applications which are in need of
> parallelization in threading context ?


No.


 
Reply With Quote
 
Diez B. Roggisch
Guest
Posts: n/a
 
      09-04-2006
Sybren Stuvel wrote:

> km enlightened us with:
>> Is there any PEP to introduce true threading features into python's
>> next version as in java? i mean without having GIL.

>
> What is GIL? Except for the Dutch word for SCREAM that is...


the global interpreter lock, that prevents python from concurrently
modifying internal structures causing segfaults.

>> when compared to other languages, python is fun to code but i feel
>> its is lacking behind in threading

>
> What's wrong with the current threading? AFAIK it's directly linked to
> the threading of the underlying platform.


There exist rare cases (see the link from bayerj) where the GIL is an
annoyance, and with the dawn of MP-cores all over the place it might be
considered a good idea removing it - maybe. But I doubt that is something
to be considered for py2.x

Diez
 
Reply With Quote
 
Sandra-24
Guest
Posts: n/a
 
      09-04-2006
The trouble is there are some environments where you are forced to use
threads. Apache and mod_python are an example. You can't make use of
mutliple CPUs unless you're on *nux and run with multiple processes AND
you're application doesn't store large amounts of data in memory (which
mine does) so you'd have to physically double the computer's memory for
a daul-core, or quadruple it for a quadcore. And forget about running a
windows server, apache will not even run with multiple processes.

In years to come this will be more of an issue because single core CPUs
will be harder to come by, you'll be throwing away half of every CPU
you buy.

-Sandra

 
Reply With Quote
 
Daniel Dittmar
Guest
Posts: n/a
 
      09-04-2006
km wrote:
> Is there any PEP to introduce true threading features into python's
> next version as in java? i mean without having GIL.
> when compared to other languages, python is fun to code but i feel its
> is lacking behind in threading


Some of the technical problems:

- probably breaks compatibility of extensions at the source level in a
big way, although this might be handled by SWIG, boost and other code
generators
- reference counting will have to be synchronized, which means that
Python will become slower
- removing reference counting and relying on garbage collection alone
will break many Python applications (because they rely on files being
closed at end of scope etc.)

Daniel
 
Reply With Quote
 
Rob Williscroft
Guest
Posts: n/a
 
      09-04-2006
Daniel Dittmar wrote in news:edhl07$b2t$(E-Mail Removed)-ag.de in
comp.lang.python:

> - removing reference counting and relying on garbage collection alone
> will break many Python applications (because they rely on files being
> closed at end of scope etc.)
>


They are already broken on at least 2 python implementations, so
why worry about another one.

Rob.
--
http://www.victim-prime.dsl.pipex.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: threading in PyQt vs threading in standard library Steven Woody Python 0 01-09-2009 07:48 AM
threading in PyQt vs threading in standard library Steven Woody Python 0 01-09-2009 07:15 AM
Cooperative threading preemptive threading - a bit confused failure_to@yahoo.co.uk Java 9 12-29-2007 01:10 AM
Re: threading support in python Jean-Paul Calderone Python 10 09-07-2006 08:02 AM
Re: threading support in python sjdevnull@yahoo.com Python 4 09-06-2006 07:46 AM



Advertisments