import threading, sys, time class MyThread(threading.Thread): def run(self): # create a file, so that when the main thread clears # all threads states, file.close() is called, which # releases the GIL and gives a chance to the loop below # to execute again. f = open("c:/temp/@temp", "w") while True: time.sleep(0) time.sleep t = MyThread() t.setDaemon(True) t.start() time.sleep(0.01)