Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)

src/c/o/concurrence-HEAD/test/teststackless.py   concurrence(Download)
        def ch1():
            for i in range(10):
                res1.append((i, stackless.getruncount()))
                stackless.schedule()
 
        def ch2():
            for i in range(10):
                res2.append((i, stackless.getruncount()))
        self.assertEquals(3, stackless.getruncount()) #main + ch1, ch2
 
        while stackless.getruncount() > 1:
            stackless.schedule()
 
        self.assertEquals(3, stackless.getruncount()) #main
 
        while stackless.getruncount() > 1:
            stackless.schedule()
 
        self.assertEquals(3, stackless.getruncount()) #main + ch1 + ch2
 
        while stackless.getruncount() > 1:
            stackless.schedule()