create as many threads as cpus
make number of threads configurable