good book on multithreaded programming with Python

Discussion in 'Python' started by Fernando Rodriguez, Nov 19, 2003.

  1. Hi,

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

    TIA
     
    Fernando Rodriguez, Nov 19, 2003
    #1
    1. Advertising

  2. In article <>,
    Fernando Rodriguez <> 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 <>
    Business: http://www.Phaseit.net
     
    Cameron Laird, Nov 19, 2003
    #2
    1. Advertising

  3. Fernando Rodriguez

    Nick Vargish Guest

    (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:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?')
     
    Nick Vargish, Nov 19, 2003
    #3
  4. Fernando Rodriguez

    Peter Hansen Guest

    GIL risky for threading and networking? (was Re: good book onmultithreaded programming with Python)

    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
     
    Peter Hansen, Nov 19, 2003
    #4
  5. Fernando Rodriguez

    MetalOne Guest

    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.
     
    MetalOne, Nov 19, 2003
    #5
  6. On Wed, 19 Nov 2003 13:34:29 -0000, (Cameron Laird) wrote:

    >In article <>,
    >Fernando Rodriguez <> 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.
     
    Fernando Rodriguez, Nov 20, 2003
    #6
  7. Fernando Rodriguez

    Nick Vargish Guest

    Re: GIL risky for threading and networking? (was Re: good book on multithreaded programming with Python)

    Peter Hansen <> 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:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?')
     
    Nick Vargish, Nov 20, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anu Raj Pradhan
    Replies:
    0
    Views:
    381
    Anu Raj Pradhan
    Jul 14, 2003
  2. G.

    A good C Programming book.

    G., Dec 30, 2003, in forum: C Programming
    Replies:
    13
    Views:
    705
    Anand
    Jan 12, 2004
  3. Kiran
    Replies:
    0
    Views:
    325
    Kiran
    Jul 3, 2007
  4. Replies:
    2
    Views:
    322
  5. vasudevram
    Replies:
    0
    Views:
    234
    vasudevram
    Apr 15, 2007
Loading...

Share This Page