I would like to test program behaviour in an SMP environment (sequential multiprocessing) using VMWare. I tried this before with a 2 processor version 5.x VM in a dual core host Intel Pentium D CPU 2.80GHz, but the behaviour was not exactly like the physical machine. I could not get a particular bug to occur in the VM. Is it recommended to use physical machines for serious SMP testing?
It is possible, however with a few limitations. To use vsmp you should at least have 4 cpu cores, and in order to get good performance, two of those cores (who should live on the same socket) should be dedicated for running this VM only. If you're not doing it this way you will quickly get bad performance.
Thanks, can you give me some examples how I can control CPU allocation/shares from a user mode .dll written in C/C++, when I do not create the process? Ideally, I would like to force the process to use only one CPU to avoid certain random sequencing differences that are undesirable and I do not yet fully understand.
Also, when you run a guest VM you don't really know from the VM which cpu(s) that this VM is using as the vcpus are being load balanced on the pcpus depending on the load.
It is however possible to specify that a single VM should only use specified pcpu(s), but this is not normally recommended as the general performance of the system will be worse, but if you're using vsmp, your vsmp enabled VM(s) will benefit from having exclusive affinity to pcpus.