Wrox Programmer Forums
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2009, 07:46 AM
Registered User
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default debug vs. release

Hi!

I am using the Microsoft Visual Studio to build a program that has several threads. The threads communicate among them reading a shared variable; thus, a thread is waiting: "while (variable == 0);", until other thread puts the variable into 1. That occurs more than one time in the program, and everything works fine in the Debug version. However, the Release version does not get out from the while bucle. I have tried some changes like:

while (variable == 0)
{
cout << ".";
}


instead of the previous:

while (variable == 0);

And it works fine in this way. I would like to know why this happens, whether there is any conflict between the variables or why, perhaps, the condition is not read again and again.

Although the program works, I would like to remove all these couts. Anybody knows how I could improve this problem?

Thank you very much,

xagutxu





Similar Threads
Thread Thread Starter Forum Replies Last Post
debug version of 1.37 release? bobarnold BOOK: Beginning Cryptography with Java 1 October 12th, 2007 06:28 PM
Ch 29 Deploying: Debug vs Release dvj81 BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 May 30th, 2006 09:50 AM
Different results in Debug and Release mode Gert Visual C++ 2 August 19th, 2005 06:47 AM
difference between release and debug builds connect2sandep General .NET 2 June 29th, 2005 01:12 PM
Debug v.s. Release in dotnet assembly orencs General .NET 1 July 14th, 2004 12:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.