As you'll recall, when you invoke the run method on an instance of Parallel, it creates (n-1) threads to run the first (n-1) CSProcess instances and runs the last CSProcess instance on its own thread.
您会想起前面介绍过,在您调用Parallel实例上的run方法时,它创建了(n - 1)个线程来运行前面(n - 1)个CSProcess实例,然后在自己的线程中运行最后一个CSProcess实例。
Next, Thread A resumes, and clearly *top and n->next do not match for this thread, because Thread B modified the contents of the top location.
接下来,线程A恢复执行,显然对于这个线程 *top和n->next不匹配,因为线程B修改了 top位置的内容。
Next, Thread A resumes, and clearly *top and n->next do not match for this thread, because Thread B modified the contents of the top location.
接下来,线程A恢复执行,显然对于这个线程 *top和n->next不匹配,因为线程B修改了 top位置的内容。
应用推荐