Calculate thread count instead of static.