MaNGOSR2
Would you like to react to this message? Create an account in a few clicks or log in to continue.
MaNGOSR2

MangosR2 is a free, open source MMORPG framework, derived from MaNGOS project


You are not connected. Please login or register

Deadlock at Map::UnloadGrid

2 posters

Go down  Message [Page 1 of 1]

1Deadlock at Map::UnloadGrid Empty Deadlock at Map::UnloadGrid Fri Dec 28 2012, 04:41

ike3



Sometimes the core hangs trying to obtain the lock at Map::UnloadGrid (e.g. when an instance map is reset):

Code:
WriteGuard Guard(GetLock(MAP_LOCK_TYPE_MAPOBJECTS));
delete getNGrid(x, y); // waits here

as the getNGrid() method has the line:

Code:
ReadGuard Guard(const_cast<Map*>(this)->GetLock(MAP_LOCK_TYPE_MAPOBJECTS));

Is it really necessary to have the double check? If we have a write lock can we obtain the read lock?

If I replace the first line with

Code:
delete i_grids[x][y];

The deadlock never occurs.

2Deadlock at Map::UnloadGrid Empty Re: Deadlock at Map::UnloadGrid Fri Dec 28 2012, 05:20

rsa

rsa
Admin

Windows problem. Exception for win maked in https://github.com/mangosR2/mangos/commit/797fbe88bfe51aed1ba249d641bb449c0f8c38b1
need move to master. unfortunately, no real multithreading in windows...

3Deadlock at Map::UnloadGrid Empty Re: Deadlock at Map::UnloadGrid Fri Dec 28 2012, 05:34

ike3



Thanks.

Hoping this will be moved to master soon as this problem almost screw up Random Bot feature in Ai Playerbot on Windows Deadlock at Map::UnloadGrid 512029371

4Deadlock at Map::UnloadGrid Empty Re: Deadlock at Map::UnloadGrid Thu Jan 17 2013, 07:04

ike3



Pity that multithreading is not supported in Windows. The problem is fixed anyway.

5Deadlock at Map::UnloadGrid Empty Re: Deadlock at Map::UnloadGrid Sat Jan 19 2013, 17:22

rsa

rsa
Admin

multithreading supported, not supported only separate map workers and inter-map object locking. this really not has any effects with online < 400.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum