没错,这位大虾说的开线程的方式具体的做法如下:我们将应用划分成一个读线程(Reading Thread)一个工作线程(Working Thread),两个线程靠同步对象(Synchronization Object,可以是Event,Mutex..
基于1个网页-相关网页
In the absence of synchronization, if one thread writes to a variable and another thread reads that same variable, the reading thread could see stale, or out-of-date, data.
没有同步时,如果一个线程读取另外一个线程正在写的变量,读的线程将看到过时的数据。
Whenever you will be writing a variable that may next be read by another thread, or reading a variable that may have last been written by another thread, you must synchronize.
不论什么时候,只要您将编写的变量接下来可能被另一个线程读取,或者您将读取的变量最后是被另一个线程写入的,那么您必须进行同步。
The first result might take you to the fourth page of the thread; click on "first" and start reading.
得到的第一个结果指向这个帖子的第四页,你可以点击“首页”从头开始阅读。
应用推荐