I've been learning about threads and processes and I understand that threads allow you to write concurrent code: where executing threads switch very quickly from one to another, giving the impression that multiple programs are running in parallel (but not truly in parallel, for which we would really need parallelism using multiple CPUs).
My machine has a dual core Intel CPU, and each core is hyper-threaded. So I have a total of 2 physical CPU cores, and 4 logical CPU cores. I did a little experiment to see if I can simultaneously run 5 (>4) YouTube videos on my web browser (Chrome), one in a separate window each. And it works, but I want to know how, exactly.
Since I don't have 5 physical CPUs (or even logical cores), they cannot be all running truly in parallel, so how are the videos seemingly running simultaneously? I say "seemingly" because, at least as much as my ears can differentiate, I don't notice short intermittent breaks where each video stops, allowing the other video to stream (even if I reduce the playback speed of every video to 0.25 times the original speed). This would be the case if we have 5 threads, one for each window, switching back and forth quick enough to give the impression of simultaneity. (I can, however, totally imagine that the switching is fast enough for my ears to be unable to distinguish between them).
To summarize, is each window running a separate thread, where the threads are switching quicker than I can differentiate them?