I have a multi threading application which for no known reason gets hanged after working for few hours. The application makes use of locks only as for synchronization and they are very few in numbers (19-20) in location as well. I wrapped the code which
gives the lock and as soon as the lock is taken by any thread I put that thread in on list with the lock information. I also makes it status as acquired. When I release the lock I make the status as release. When a lock is requested it is in waiting state.
Now if thread deadlock is there this list can never be empty as at least one lock must be in acquired status and other locks would be in waiting status.
The application UI hangs only in production environment and works fine with local setup. When I get the logs of the above list, the list of thread with locks is always empty when the UI is hanged. I feel that since the list is empty there shall be no deadlock
being lock list as empty but I do not know any other reason a UI could be hanged for indefinite period
without a thread deadlock.
Can someone please suggest what else could be wrong in the system so as UI is getting hanged. I seriously feel if there is any thread deadlock then it must have appeared in the log which I have already tested by creating some deadlocks on sample code. Whenever
there is a deadlock in sample code the threads appear in the list and log which I create but in my application even when the UI is hanged nothing is printed in the log and locks list is empty as well.
Please help and suggest some other pointers which could be the cause of UI hang