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

You are not connected. Please login or register

Deadlock at Map::UnloadGrid

View previous topic View next topic Go down  Message [Page 1 of 1]

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

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

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

as the getNGrid() method has the line:

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

delete i_grids[x][y];

The deadlock never occurs.

View user profile

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


Windows problem. Exception for win maked in
need move to master. unfortunately, no real multithreading in windows...

View user profile

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


Hoping this will be moved to master soon as this problem almost screw up Random Bot feature in Ai Playerbot on Windows

View user profile

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

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

View user profile

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


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

View user profile

Sponsored content

View previous topic View next topic Back to top  Message [Page 1 of 1]

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