Skip to content

Final Done Task Repeating #10

@graingerkid

Description

@graingerkid

With the following example, if I run it and then comment out the put loop and then run it again, I get 99 printed.

def worker():
    while True:
        try:
            item = q.get()
            print item
        except:
            pass
        finally:
            q.task_done()

for i in range(3):
     t = Thread(target=worker)
     t.daemon = True
     t.start()

for item in range(100):
    q.put(item)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions