Thread.exit : Thread Exit : Thread PYTHON examples


PYTHON examples » Thread » Thread Exit »

 

Thread.exit


Thread.exit: spawn threads to watch shared global memory change;

import thread                                   
exitstat = 

def child():
    global exitstat
    exitstat = exitstat + 1
    threadid = thread.get_ident()
    print 'Child #:', threadid, exitstat
    thread.exit()
    print 'never reached'

def parent():
    while 1:
        thread.start_new_thread(child, ())
        if raw_input() == 'q'break

parent()

           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Thread
» Thread Exit