我有一位控制员,其唯一职能是增加一个模型(即:foo_count
)的计票量并加载一个观点。
让我们假设我有2个网络事例。 如果同时有10个同时用户被击中该网页/控制器。 我的算法是10吗?
是否有某种种族条件? 由于两者同时发生,因此两份网络申请将携带一个模型<代码>Foobar的复印件,其中foo_count
等于0至0。
This means they were both operating on their own copy of Foobar
that wasn t aware of the change the other web instance was doing. Which also means, the count will unlikely be 10.
如何解决这一问题?