def runThread(func): #lock.acquire() print(stackless.getruncount(), stackless.getthreads()) numCurrentThreads = stackless.getthreads() latestThread = numCurrentThreads[-1] numCurrentThreads = len(numCurrentThreads) subthreads = list() for i in range(numCurrentThreads): subthreads.append(Thread(target=checkedRun, args=(func, ))) subthreads[-1].start() print(stackless.getruncount(), stackless.getthreads()) print(stackless.main) time.sleep(2)
def test_get_threads(self): self.assertEqual(type(stackless.getthreads()), list)
def run2(): stackless.tasklet(first2)() stackless.tasklet(second2)() #import pdb; pdb.set_trace() print(stackless.getruncount(), stackless.getthreads()) stackless.run()