I'm on the 12th gen Intel CPUs with hyperthreading enabled. From my lscpu output, I can see that logical cores 0 and 1 both map to physical core 0. I understand that if I allocate processes P0 and P1 to 0 and 1, respectively, they'll essentially multiplex physical core 0's resources via SMT. If I allocate both P0 and P1 to logical core 0, however, how is this execution handled? Does the OS just continually context switch them?
I'm just seeing some interesting behavior where P0 and P1 run faster when they're allocated on the same logical core (note that P0 and P1 communicate), faster than if they're multithreaded on the same physical core, or allocated to two different physical cores altogether. I can't explain this.