面试中的一个问题
int count = 0;
void func1()
{
  for ( int i =0 ; i < 10; ++i )
    count = count + 1;
}
void func2()
{
  for ( int i =0 ; i < 10; ++i )
    count++;
}
void func3()
{
  for ( int i =0 ; i < 10; ++i )
    ++count;
}
int main()
{
  thread(func1);
  thread(func2);
  thread(func3);
  //joining all the threads
  return 0;
}
问题是:count理论上可能取的值范围是多少?上限显然是 30,但下限是多少?他们告诉我这是10,但我不确定。否则,我们为什么需要内存屏障?
那么,该范围的下限是多少?