[FIXED] I found a deadlock
#1
A quick overview of what thread locks what criticalsection
Code:
ServerTickThread
Owns cServer::m_CSClients
Wait cSocketThreads::m_CS

cSocketThread
Owns cSocketThreads::m_CS
Wait cServer::m_CSClients

cServer::ServerListenThread
Wait cSocketThreads::m_CS // Doesn't really matter, but it blocks new clients

The deadlock is between ServerTickThread and cSocketThread

ServerTickThread callstack:
[Image: Screenshot-2012-03-04_14.13.04.png]


cSocketThread callstack:
[Image: Screenshot-2012-03-04_14.14.23.png]
Reply
Thanks given by:
#2
I guess client deleting can be done postponed - in the TickThread make a list of clients to be deleted, move clients to that list while the CS is locked, then unlock the CS and delete clients from the list.
Reply
Thanks given by:
#3
I fixed your deadlock (rev 369)
Reply
Thanks given by:




Users browsing this thread: 3 Guest(s)