#slthread.py import stackless import thread def threadfunc(): for i in range(10000): a = 2*3 print "one" thread.start_new_thread(threadfunc, ()) print "two" stackless.run() print "three"