dabeaz / thredo

Thredo was an experiment - It's dead. Feel free to look around.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

example on README page contains a `typo`

skgbanga opened this issue · 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()

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

When people sleep, do they dream? Of threads?