We sometimes have errors from many places: Aborted code because it ran for too long. (2 - 3 seconds)
But our code should not be executed for so long.
Our logic is executed within the critical section. But the lock object is only one and therefore can not be deadlock from our side.
We have many places where it stops at System.Array.Copy.
For example:
- Code: Select all
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Collections.Generic.List`1.ToArray()
at GameModel.Field.GameModel.IField_forCommands.RemoveAllKilledCards()
at GameModel.TurnCommand.GameModel.ITurnCommand.Execute()
at GameModel.Turn.GameModel.ITurn.Execute()
at GameModel.Model.GameModel.IModel.Simulate(sPos pos, eDir direction, dOnSimulateQuestions strategy)
at GameRoom.State_Fight_WaitingPlayerAction.MakeMoveTurnStrategy.GameRoom.State_Fight_WaitingPlayerAction.IMakeTurnStrategy.MakeTurn()
at GameRoom.State_Fight_WaitingPlayerAction.TryToMakeTurn(IMakeTurnStrategy strategy)
at GameRoom.State_Fight_WaitingPlayerAction.OnPlayerGotMessage(ePlayer playerType, NetMessage msg)
at GameRoom.GameRoom.OnPlayerGotMesage(NetMessage msg, ePlayer player)
at GameRoom.GameRoom.OnPlayerGotMessage(NetMessage msg, IPlayer player)
at NetWork.UserPlayer.OnGotMessage(PIOPlayer player, Message message)
at NetWork.Room.NetWork.IRoom.GotMessage(PIOPlayer player, Message message)
at NetWork.PIORoom.GotMessage(PIOPlayer player, Message message)
Less often we have problems with the critical section:
- Code: Select all
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Monitor.Enter(Object obj)
at NetWork.Room.TimerCallbackExt.<Execute>b__5_0()
May be there are something special in working with the critical sections and player.io.
May be a garbage collector is locking a thread.
These are our ideas.
Сan someone help?
Thanks.