-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
死锁问题 #463
Comments
现在基本确定死锁问题由逻辑内部引起(因为在服务器上发现了没有观战者但是死锁的容器)。初步看了一下逻辑,发现了几点会导致死锁的地方: 在 ChangePlayerState 中,连续两次对 gameObjLock 上锁(在 gameObjLock 被锁时修改 IsMoving) THUAI6/logic/GameClass/GameObj/Character/Character.cs Lines 324 to 336 in 04c651e
另一个问题 是 MoveLock 和 gameObjLock 的死锁问题。比如,这里用 MoveLock 加锁了,而 ChangePlayerState 中对 gameObjLock 加锁,即在这里用 MoveLock 锁 gameObjLock THUAI6/logic/Gaming/CharacterManager .cs Lines 23 to 30 in 04c651e
THUAI6/logic/GameClass/GameObj/Character/Character.cs Lines 324 to 336 in 04c651e
但在 MoveEngine 中又用 MoveLock 锁 gameObjLock THUAI6/logic/GameEngine/MoveEngine.cs Lines 88 to 89 in 04c651e
THUAI6/logic/GameEngine/MoveEngine.cs Lines 205 to 206 in 04c651e
这些地方都有可能导致死锁 |
@TCL606 我记得 C# 锁是可重入的,持有锁的线程可以再次加锁来着; |
确实,看错了 |
鸵鸟算法成功了,死锁暂时没有发现过了 |
???STM 鸵鸟算法 |
又发现死锁辣! |
哈哈哈哈哈哈哈哈哈哈🤣🤣🤣 |
Describe the bug
Server 中存在潜在的死锁问题
To Reproduce
暂不清楚,但服务器上的确观察到此现象
Desktop (please complete the following information):
Ubuntu 22.04
Additional context
死锁问题是非常严重的,将直接导致比赛不能正常进行。欢迎大家讨论一下当前死锁问题的原因,解决这个问题。以及如果发现了复现该问题的方式,可以在本 issue 中提出。
The text was updated successfully, but these errors were encountered: