I'm currently learning about multithreading, threads, threadpools, and such. I have read that the number of threads cannot be more than the number of logical processors your computer has (or at least there is no advantage to be gained since your CPU cannot handle more).
So what is the expected behavior if you write code that created hundreds of threads on a computer with say, 12 logical processors? Do they queue up? Do they wait for each other? Or does it give you an error? If you have a process that could benefit from 100 continuously running threads, but only have 12 cores, what is the best way to handle this? I often open my task manager to see hundreds of processes and thousands of threads are running. How does that work?
Also, what if I'm running a program say in Windows, with a bunch of other applications running (ie. Chrome, MS Excel, Skype, ect...), and perhaps a bunch of background services (ie. Windows Defender, Wifi services, ect...) Do these other applications take up logical processors, thus decreasing the number of logical processors available to my threaded program?