dabeaz / thredo

Thredo was an experiment - It's dead. Feel free to look around.
MIT License
338 stars 19 forks source link

example on README page contains a `typo` #5

Open skgbanga opened 6 years ago

skgbanga commented 6 years ago

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()
dabeaz commented 6 years ago

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

CreatCodeBuild commented 6 years ago

When people sleep, do they dream? Of threads?