Skip to content

Thread pool fails with 'NoneType' object has no attribute 'Empty' #1

@samof76

Description

@samof76

Thread pool fails with 'NoneType' object has no attribute 'Empty'

When set the poolsize to 2 and the arg_list of the size 3 this happens. Here is the sample code.

from threadpool import makeRequests, ThreadPool

pool = ThreadPool(2)

def greet(greeting):
for i in range(1,10):
print greeting
sleep(1)

def main():
greetings = ["hello","gracious","bonjour"]
requests = makeRequests(greet,greetings)
[pool.putRequest(req) for req in requests]
pool.wait()

if name == 'main':
main()

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