import threading  

N = 1000000                             # Increase if necessary
count = 0

class timer(threading.Thread):    
    def run(self):
        global count
        for i in xrange(N):
            count += 1
               
def test():   
    thread1=timer()   
    thread2=timer()   
    thread1.start()  
    thread2.start()
    thread1.join()
    thread2.join()
    print 'final count:', count
    print '  should be:', 2*N
       
if __name__=='__main__':   
    test()
