CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    9

    Threading problem in release version of the software

    My socket software works differently in debug version and release version
    i traced down to the problem of multithreading.
    In Release mode
    if i chosed debug multithreaded DLL (project->setting->C/C++ Tab-> Category:
    Code Generation -> user runtime library) , my program worked fine! if i use regular
    multithreaded DLL. my socket generates trashcode.
    My thread class was derived from CWinThread, the sockets class were dyanimically
    allocated in one of the functions in my thread class

    i began the thread in one of the view's constructor.
    T = (CMyThread*)AfxBeginThread(RUNTIME_CLASS(CMyThread), 0, 0, 0);



    What could be wrong?

    Franky

    http://innocreations.cjb.net

  2. #2
    Guest

    Re: Threading problem in release version of the software

    Something to consider: in the past I have had a Debug version work fine, but the Release version died a horrible death. It turned out that a memory operation was overflowing by 1 byte under certain circumstances. This didn't phase the Debug version, because the memory allocator puts "guard bytes" on the front and back of each allocated block; the overflow simply clobbered the "guard bytes" with no bad side effects. When compiled in Release mode--and without "guard bytes"--the overflow now clobbered the heap information of the next memory block, which had *real bad* side effects. If something works in Debug mode, but fails in Release mode, I start looking long and hard at my memory allocation and manipuation...

    Cheers!
    Humble Programmer
    ,,,^..^,,,


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured