Q:

Threading in C++ using std::thread

I'd like to know if I initialize four std::thread 's, will this crash a dual thread cpu or are std::thread 's a virtual thread kind of thing. 
I mainly want to know because a program I am writing for class would go much faster with four threads, but I have no idea how many threads my grader has on their CPU. Mine has 8 but hers could easily have 2. I don't want to crash her system, so any help would be 
I'm fairly new to Computer Science so I welcome any help I can get. 

A:

The number of threads doesn't have to be limited to the number of cores. The OS will just schedule the threads as cores become available. 
That said, you can use hardware_concurrency() to find you how many cores/processors are available, and base the number of threads you use on that. 

