Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » INTERLOCK and Mutex object
INTERLOCK and Mutex object [message #40839] Mon, 23 September 2013 00:18
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
Following this discussion, I used INTERLOCK for two different thread in an multithreaded application.

For some solved problems, new ones are coming.

Now the application, after a long working time, crash apparently at then INTERLOCK line:

  //App.icpp file
  ...
  Mutex 	reqBufferMutex;


  //Comm.cpp file
  ...
  RLOG("101");
  while(true)	
  {
    INTERLOCKED_(reqBufferMutex)
    {
      RLOG("102");
      Array<ComRequest> &v = reqBuffer.GetAdd(n);
      RLOG("103");
      for(j = 0; j < v.GetCount(); j++)
      ...


Time by time, the application crash after logging "101".
Win 7 and VS2010 complains about stack overflow and "New" instance.

1) The log file can be not complete due to the application crash?
2) The crash can be caused from the next row: "Array<ComRequest> &v = reqBuffer.GetAdd(n);" that I suppose is the most probably reason of the crash?
2.1) And in this case, why this common row used in many other parts, cause the crash only after a long loop? (In the test that I am doing reqBuffer.GetAdd(n), at the time of the crash, is not different than the many other earlier cycles.
Previous Topic: Required simple MT lesson
Next Topic: Keep-Alive in HttpRequest
Goto Forum:
  


Current Time: Sat Apr 20 02:27:54 CEST 2024

Total time taken to generate the page: 0.02661 seconds