Passing data between threads

Discussion in 'Python' started by Erik de Castro Lopo, May 2, 2004.

  1. Hi all,

    I have a script where I create a thread using the thread module. The
    thread runs its course and then calls thread.exit ().

    However, I'd like to pass some data back to the parent thread before alling
    thread.exit () but I can't figure out how.

    Any ideas?

    Erik
    --
    +-----------------------------------------------------------+
    Erik de Castro Lopo (Yes it's valid)
    +-----------------------------------------------------------+
    "It's far too easy to make fun of Microsoft products, but it takes a
    real man to make them work, and a god to make them do anything useful"
    -- Anonymous
     
    Erik de Castro Lopo, May 2, 2004
    #1
    1. Advertising

  2. Erik de Castro Lopo

    Uwe Hoffmann Guest

    Erik de Castro Lopo wrote:

    > However, I'd like to pass some data back to the parent thread before alling
    > thread.exit () but I can't figure out how.


    take a look at the Queue class (e.g. calling thread provides queue as
    parameter):
    http://docs.python.org/lib/module-Queue.html

    greetings
    uwe
     
    Uwe Hoffmann, May 2, 2004
    #2
    1. Advertising

  3. Erik de Castro Lopo

    Uwe Hoffmann Guest

    Uwe Hoffmann wrote:
    > Erik de Castro Lopo wrote:
    >


    >> thread.exit () but I can't figure out how.


    oh you are using the "old thread" module. Try to switch to
    the threading module if you are not on a very
    old python version ( in this case the module Queue is not available)
     
    Uwe Hoffmann, May 2, 2004
    #3
    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. Dennis Gavrilov
    Replies:
    1
    Views:
    1,454
    Dennis Gavrilov
    Jul 24, 2003
  2. shaun82
    Replies:
    3
    Views:
    1,122
    Esmond Pitt
    Apr 5, 2005
  3. yoda
    Replies:
    2
    Views:
    445
    =?utf-8?Q?Bj=C3=B6rn_Lindstr=C3=B6m?=
    Aug 1, 2005
  4. Marcin Rodzik
    Replies:
    6
    Views:
    358
    Marcin Rodzik
    Aug 25, 2011
  5. Marcin Rodzik
    Replies:
    1
    Views:
    280
    markspace
    Aug 2, 2011
Loading...

Share This Page