What does spawning a thread look like in terms of computer hardware?
I understand that threads can be used to do work in parallel. I have also read the Rust programming book and understand how their multithreaded web server works. But I had some questions about how all of it comes together in terms of computer hardware.
Does each thread spawned use another available core?
Suppose I have 8-cores on my PC. I have 20 separate tasks that will take a long time. If I spawn 20 threads to do these tasks, will a maximum of 8 tasks be executing in parallel at any one time?
Is there any benefit of spawning only enough threads for the number of cores available?