当一执行绪将资源修改为无效状态,而接著另一执行绪尝试存取这个资源并在无效状态中使用它时,就出现竞争情形。
A race condition exists when a thread modifies a resource to an invalid state, and then another thread attempts to access that resource and use it in the invalid state.
如果您使用这个变数将参考传回类别的执行个体,则执行绪共用执行绪可以修改执行个体的成员,并当做传回值使用。
If you use this variable to pass a reference to an instance of a class, the members of the instance can be modified by the thread-pool thread and used as return values.
程序会在系统排程器将执行控制提供给程序的其中一个执行绪时执行。
A program executes when the system scheduler gives execution control to one of the program's threads.
应用推荐