# Collection of code snippets by Arne Vajhøj 
# (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import threading

class setthr(threading.Thread):
    def run(self):
        global x
        x = 123

class prtthr(threading.Thread):
    def run(self):
        global x
        print x

x = 0
t1 = setthr()
t1.start()
t1.join()
t2 = prtthr()
t2.start()
t2.join()
