What happens when we create more threads than thread:: hardware_concurrency()?
So i was asked in an interview what happens when you spawn more threads in a process than CPU's maximum limit .
My answer was it causes scheduling delays, memory issues and context switching overhead .
But he still kept pushing on what happens when you spawn more threads than that . I really didn't understand what he wanted as a answer? Because even if you spawn more threads or even a lot more threads than this system should be fine.
So what is it that I was supposed to say ? Like is this something related to C++ threading memory model or like totally OS related issue?
Posted Jun 8, 2026, 4:34 PM UTC
4735