Experimenting with thread pools using functors for flexible thread task management