473,396 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Debug and Release code have different behavior

Hi,

I have a multithreading application that reads and writes to com ports.

The debug version works with no problems, but the release version don't.
They are the same code, the difference is how the solution was compiled.

The problem is:
The release version fails to read from one of the com ports, and locks up
until the timeout is expired.
How I know? I created a log file to know what was happening to the release
version, and found where it locks up.

Any idea?

Carlos

Nov 16 '05 #1
1 2189
Could be a timing issue causing a deadlock which you are only hit in the
release version because it runs faster without the debug code.

Look at your code for scenarios where 2 or more resources (e.g. COM ports)
are obtained in a different order on separate threads.

e.g. A & B are resources, 1 & 2 are threads:
following will deadlock - thread 2 gets B and is waiting for A, thread 1 has
A and is waiting for B
1 A...B
2 B....A

following is OK because thread 2 is slower - thread 1 has already released B
1 A...B
2 B....A
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ss | last post by:
Hi I built an exe in console debug mode & Release mode . The console debug mode -exe works fine ...but the release mode EXE starts well but fails mid way . The exe is being started as a...
4
by: | last post by:
Hi, does anyone know what would be the (most common) reasons to get difference answers in VC++.net between running in release and debug ? Thanks, JC
10
by: Scott | last post by:
I have a simple asp.net app which works fine in debug mode, but crashes on the following line when I run it on the production server: Dim dt As DataTable I have tried the following variations...
7
by: Srinivasa Rao | last post by:
I have read in one article that when we compile the application in release mode, all the debug classes and properties will be automatically removed from the code. I tried to implement this thing by...
7
by: Tom | last post by:
How can I make code not execute for a debug build, but do execute for a production build? I have code which prompts for an account and password when the program starts up. It is a pain to have to...
6
by: bantamweight | last post by:
Hi, I create a project with vs2005 (both c++ and c# are used, sames the problem is about c++) and it working well in Debug version but the result is wrong in Release version. I checked again and...
4
by: Hardy Wang | last post by:
Is there a way I can disable Web Deploy Project to run while I am in debug mode? I think Web Deploy Project is very foolish, it could not detect if code of a website is changed or not, it will...
5
by: Jonas Hallgren | last post by:
Hello, Is there any general tips on how to solve this problem: my Debug version runs fine but when I do a Release version I get error messages!? I'm hoping it is a simple option somewhere or...
2
by: Dave Johansen | last post by:
I just converted a solution from Visual Studio 2003 to Visual Studio 2005 and the Debug mode seems to be running just fine, but the Release mode crashes on the following code: std::ifstream...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.