The Machine is Dual-Core, the OS uses a Multi-Processor kernel. In order to run some performance assessments, I want to set the thread-affinity of the JVM to a single core. However, I am worried that I will get skewed performance measurements as the JVM may be unaware that it is now constrained to a single core, but still using multi-processor primitives for thread synchronization and garbage collection. While the garbage collector can be tuned from the command line, that's not possible for the thread synchronization.
Now, the JVM uses mostly(*) OS-threads for its threads. So maybe the question should be rather "Do OSes (Windows/Linux) use correct synchronization primitives in multithreaded applications that are constraint to using a single core by setting the thread-affinity of the corresponding process?"
(*) That's not precisely true on Windows, where the JVM spinns on its own before calling the OS. That behavior can be controlled via -XX:+UseSpinning and -XX:PreBlockSpin settings.