Attempt to fix #42:

Implements a thread pool, it works well on linux