os::bind_to_processor(uint processor_id);

  • 引数で渡されたプロセッサIDにカレントプロセスをバインドする
  • Linux版、Windows版では未実装。
//Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp)
bool os::bind_to_processor(uint processor_id) {
  // Not yet implemented.
  return false;
}

ちなみにSolaris版はこんな感じ。

//Solaris版(jdk7/hotspot/src/os/solaris/vm/os_solaris.cpp)
Bool os::bind_to_processor(uint processor_id) {
  // We assume that a processorid_t can be stored in a uint.
  assert(sizeof(uint) == sizeof(processorid_t),
         "can't convert uint to processorid_t");
  int bind_result =
    processor_bind(P_LWPID,                       // bind LWP.
                   P_MYID,                        // bind current LWP.
                   (processorid_t) processor_id,  // id.
                   NULL);                         // don't return old binding.
  return (bind_result == 0);
}