In the hotspot code, os::is_MP is called to detect whether the system contains multiple processor or not. It is called by Atomic::add in JNI_CreateJavaVM for the first time. However, that time, os::init() hasn't been called, so processor count is 0, so os::is_MP always returns false when it is called for the first time. As a result, Atomic::add won't be thread safe.
|