You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All on_AM_XXXX() functions are called sequentially.
Actually this is done by the actor model, you can search this term for better understanding.
with this model we don't need to add lock for multi-threads program.
想请教下这两种情况:
情况A: 怪物搜寻附近玩家并主动发起攻击;
情况B: 怪物被玩家攻击后对玩家进行反击。
这两种情况是如何保证在一个线程里完成的呢。
虽然使用mutex很容易实现,但是这种情况下大量进行加锁/解锁,会严重影响程序效率吧。
我看到你的程序中会先从 m_offenderList 里面读取玩家UID,如果没有读取到则从 m_inViewCOList 计算出最近的玩家UID。
我没有搞明白这是如何保证它们在一个线程里面安全执行的
The text was updated successfully, but these errors were encountered: