import threading import sys print sys.executable class F(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.setDaemon(True) lst = [0] def func(frame, *args, **kwargs): # print frameVarsToXML(frame) lst[0] += 1 if lst[0] < 30: #start up to 30 threads (actually, this happens even with less threads) F().start() return func sys.settrace(func) from posix import * dir = unicode('/home/fabioz/jython') print listdir(dir)