corecount Simple module exposing number of cores on the local machine using C++11's awesome stdlib see here See it implemented here Note that the video used Int_val instead of Nativeint, that was for brevity.