问题描述 使用一个全局变量测试多线程同时访问一个变量的性能,结果却报错了 多重定义了,于是顺藤摸瓜,找到了变量thread_index的位置 // MyThread.h int thread_index = 0; 以及使用这个变量的地方—— // Source.cpp #include"MyThread.h" .