visual c++ - Hangs/Random crashes on MFC, VC++, multi threaded application -


i work on mfc application. users report application crashes randomly. crashes occur during different phases while running application , not reproducible (the application might crashing multiple reasons ui, inconsistent data, threading issues).

how can go forward debugging these issues.

when have multiple threads share data, need provide synchronized access data. have deal synchronization issues related concurrent access variables , objects accessible multiple threads @ same time. otherwise you'll end having unpredicted behavior including app crashes. please guard data using ccriticalsection , similar objects.

here example:

csinglelock lock(&m_critsection); lock.lock();  m_data = data;  lock.unlock(); 

Comments