Set thread count.