title: How to scale threads according to CPU cores?
body: <p>I want to solve a mathematical problem with multiple threads in Java. my math problem can be separated into work units, that I want to have solved in several threads.</p>
  
  <p>I don't want to have a fixed amount of threads working on it, but instead an amount of threads matching the amount of CPU cores. My problem is, that I couldn't find an easy tutorial in the internet for this. All I found are examples with fixed threads.</p>
  
  <p>How can this be done? Can you provide examples?</p>