title: What is the relationship between number of CPU cores and number of threads in an app in java?
body: <p>I'm new to java <strong>multi-threaded</strong> programming. The question that has came to my mind is that how many threads can I run according to the number of my <strong>CPU cores</strong>. and if I run threads more than <strong>CPU cores</strong> will it be an overhead for the machine to run the app. for example when we have a server machine which has a server software that run 2 threads(main thread + developer thread), will it be an overhead for the server when more simultaneous clients make socket connections to the server or not?</p>
  
  <p>Thanks.</p>