C++ Thread, shared data

前端 未结 10 1856
悲&欢浪女
悲&欢浪女 2020-12-04 22:35

I have an application where 2 threads are running... Is there any certanty that when I change a global variable from one thread, the other will notice this change? I don\'t

10条回答
  •  情歌与酒
    2020-12-04 23:06

    Your solution will use 100% CPU, among other problems. Google for "condition variable".

提交回复
热议问题