thredo icon indicating copy to clipboard operation
thredo copied to clipboard

example on README page contains a `typo`

Open skgbanga opened this issue 7 years ago • 2 comments

In your python talk, at 33.34 you talked about how you could have made a mistake by calling join on worker group instead of the queue. https://youtu.be/U66KuyD3T0M?t=33m35s

Seems like you have made that in the example on the README page.

def main():
    q = thredo.Queue()
    with thredo.ThreadGroup(wait=None) as workers:
        for n in range(4):
            workers.spawn(worker, q)

        for n in range(10):
            q.put(n)
            thredo.sleep(1)

        workers.join()     # should be q.join()

skgbanga avatar Aug 07 '18 15:08 skgbanga

D'oh! Yes, will make a fix.... maybe I need more sleeping...

dabeaz avatar Aug 08 '18 11:08 dabeaz

When people sleep, do they dream? Of threads?

CreatCodeBuild avatar Aug 08 '18 19:08 CreatCodeBuild