Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > good book on multithreaded programming with Python

Reply
Thread Tools

good book on multithreaded programming with Python

 
 
Fernando Rodriguez
Guest
Posts: n/a
 
      11-19-2003
Hi,

Any recommendation for a good book on multithreaded programming with Python?
O

TIA
 
Reply With Quote
 
 
 
 
Cameron Laird
Guest
Posts: n/a
 
      11-19-2003
In article <(E-Mail Removed)>,
Fernando Rodriguez <(E-Mail Removed)> wrote:
>Hi,
>
>Any recommendation for a good book on multithreaded programming with Python?

.
.
.
Do you *really* want
concurrent programming with Python
or
programming with Python's threads
or
Python programming with low-level threads
or
...?
--

Cameron Laird <(E-Mail Removed)>
Business: http://www.Phaseit.net
 
Reply With Quote
 
 
 
 
Nick Vargish
Guest
Posts: n/a
 
      11-19-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (Cameron Laird) writes:

> Do you *really* want
> concurrent programming with Python
> or
> programming with Python's threads
> or
> Python programming with low-level threads


Yes, please.

I'm not the OP, but right now I'm porting a C/C++ program from Win32
to Python on Linux and OS-X. The original program relies quite heavily
on threading.

A book that covers all the above options would really help me figure
out the optimal approach to this project. I'm especially concerned
that the GIL will make a pure-Python approach risky, since this
application involves a fair abount of network data and real-time data
processing.

As it is, I have to read several discussions of each
approach. Unfortunately, on this project learning time is not billable
time. (Fortunately, experimentation is billable, and with Python,
learning and experimenting are often one and the same...)

Nick

--
# sigmask || 0.2 || 20030107 || public domain || feed this to a python
print reduce(lambda x,y+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?')
 
Reply With Quote
 
Peter Hansen
Guest
Posts: n/a
 
      11-19-2003
Nick Vargish wrote:
>
> A book that covers all the above options would really help me figure
> out the optimal approach to this project. I'm especially concerned
> that the GIL will make a pure-Python approach risky, since this
> application involves a fair abount of network data and real-time data
> processing.


What risk concerns you with respect to doing networking and "real-time"
processing using Python, given that the GIL exists? Would you have the
same concerns if you didn't even know of the existence of the GIL?
(I believe you should have those concerns, but just because you're
trying to use an unfamiliar environment for something fairly intensive,
not because it's Python specifically, or the GIL.)

I do lots of "network data and real-time data processing" using Python
and have not encountered any particular difficulties, and certainly none
that can be attributed to the existence of the GIL.

Is this a case of fear arising out of ignorance? If so, why not just
write a quick test/experiment that will remove or affirm your concern?
It would be trivial to write a program that created a dozen threads,
each doing processing that would take five seconds of dedicated CPU time,
and a network thread which grabs data from an external source as it
becomes available, at whatever rate you need. You'll likely find out
that with an adequate CPU, everything will work just as you need it to,
and that the only difference between the old program and the new is that
the Python-based one consumes a lot more CPU time for the same data...

If you have specific reasons for the concern, please provide them so
we can address them. The GIL certainly doesn't get in the way of
soft real-time work in any way that's significant.

-Peter
 
Reply With Quote
 
MetalOne
Guest
Posts: n/a
 
      11-19-2003
A good book on writing multi-threaded applications is "Concurrent
Programming in Java" by Doug Lea. The focus is more on multi-threaded
applications than on Java.
 
Reply With Quote
 
Fernando Rodriguez
Guest
Posts: n/a
 
      11-20-2003
On Wed, 19 Nov 2003 13:34:29 -0000, (E-Mail Removed) (Cameron Laird) wrote:

>In article <(E-Mail Removed)>,
>Fernando Rodriguez <(E-Mail Removed)> wrote:
>>Hi,
>>
>>Any recommendation for a good book on multithreaded programming with Python?

> .
> .
> .
>Do you *really* want
> concurrent programming with Python
>or
> programming with Python's threads
>or
> Python programming with low-level threads
>or
> ...?


An introduction to general concurrent programming concepts, using python for
the examples.
 
Reply With Quote
 
Nick Vargish
Guest
Posts: n/a
 
      11-20-2003
Peter Hansen <(E-Mail Removed)> writes:

> Is this a case of fear arising out of ignorance?


Most probably. On the other hand, I probably wouldn't have spoken up
if I hadn't seen the post I replied to.

I am planning on as pure Python an approach as possible, and have been
from the start. I certainly wasn't trying to borrow trouble from the
future or optimize too early in development.

> If you have specific reasons for the concern, please provide them so
> we can address them.


This is the attitude that makes me tell my boss(es) that I get better
support from the open source community than I ever could from a
commercial outfit. Thanks!

> The GIL certainly doesn't get in the way of
> soft real-time work in any way that's significant.


I'm going to proceed with that expectation, thanks again.

Nick

--
# sigmask || 0.2 || 20030107 || public domain || feed this to a python
print reduce(lambda x,y+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?')
 
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: Advanced Python Programming Oxford Lectures [was: Re: *Advanced*Python book?] Michele Simionato Python 1 03-27-2010 06:10 AM
Trouble developing API for easy parallel/multithreaded programming k04jg02@gmail.com C++ 2 02-18-2008 09:52 PM
Need good book leads on Programming C++ (Design/Coding) for high performance systems. Kiran C++ 0 07-03-2007 10:28 AM
A good C Programming book. G. C Programming 13 01-12-2004 10:34 AM
good book on Apsect Oriented programming (AOP) Anu Raj Pradhan Java 0 07-14-2003 10:10 PM



Advertisments