我正在具有4个运行centOS的Operton 6272处理器的计算机上进行NUMA实验。有8个NUMA节点,每个节点都有16GB内存。
这是我正在运行的一个小型测试程序。
void pin_to_core(size_t core)
{
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(core, &cpuset);
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
}
int main()
{
pin_to_core( 0 );
size_t bufSize = 100;
for( int i = 0; i < 131000; ++i )
{
if( !(i % 10) )
{
std::cout << i << std::endl;
long long free = 0;
for( unsigned j = 0; j < 8; ++j )
{
numa_node_size64( j, &free );
std::cout << "Free on node " << j << ": " << …
Run Code Online (Sandbox Code Playgroud) 似乎在64位平台上,有一个8字节长度的前缀是合理的.如果我们可以解决超过4Gb的内存,为什么不允许,比如5Gb字符串?答案只是"按规范"还是存在一些我不知道的互操作性/向后兼容性原因?谢谢.