Thread pool example in Python