Click here to Skip to main content
15,889,403 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Environment for PIC programming Pin
castingflame28-Sep-11 4:18
castingflame28-Sep-11 4:18 
GeneralRe: Environment for PIC programming Pin
CodingLover28-Sep-11 18:07
CodingLover28-Sep-11 18:07 
QuestionWaitForSingleObject Pin
john563227-Sep-11 22:58
john563227-Sep-11 22:58 
AnswerRe: WaitForSingleObject Pin
Cedric Moonen28-Sep-11 1:21
Cedric Moonen28-Sep-11 1:21 
AnswerRe: WaitForSingleObject Pin
Code-o-mat28-Sep-11 4:37
Code-o-mat28-Sep-11 4:37 
GeneralRe: WaitForSingleObject Pin
Albert Holguin29-Sep-11 3:37
professionalAlbert Holguin29-Sep-11 3:37 
GeneralRe: WaitForSingleObject Pin
Code-o-mat29-Sep-11 3:40
Code-o-mat29-Sep-11 3:40 
AnswerRe: WaitForSingleObject Pin
Roger Stoltz28-Sep-11 21:18
Roger Stoltz28-Sep-11 21:18 
You probably have code looking like this in your thread:
C++
while( !m_bStopPushThread )
{
   // Do whatever the thread is supposed to do
}

Chances are that the m_bStopPushThread has been optimized into a register in your thread controlling loop which means that the thread won't see the value change.
This happens if the variable is not written to inside the loop.
Building a debug version disguises this behaviour since optimizations usually are turned off.

The remedy is to declare the variable m_bStopPushThread as volatile, which will tell the compiler to read its value from the variables memory address every time and not to hold its value in a register.

"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


AnswerRe: WaitForSingleObject Pin
Albert Holguin29-Sep-11 3:42
professionalAlbert Holguin29-Sep-11 3:42 
QuestionCRichEditCtrl Flickring Pin
john563227-Sep-11 19:43
john563227-Sep-11 19:43 
AnswerRe: CRichEditCtrl Flickring Pin
Madhu Nair27-Sep-11 20:33
Madhu Nair27-Sep-11 20:33 
AnswerRe: CRichEditCtrl Flickring Pin
Software_Developer27-Sep-11 20:37
Software_Developer27-Sep-11 20:37 
AnswerRe: CRichEditCtrl Flickring Pin
Code-o-mat27-Sep-11 22:02
Code-o-mat27-Sep-11 22:02 
GeneralRe: CRichEditCtrl Flickring Pin
john563227-Sep-11 22:23
john563227-Sep-11 22:23 
QuestionMS TR1 Regex Pin
TenFiftyTwo27-Sep-11 12:54
TenFiftyTwo27-Sep-11 12:54 
QuestionRe: MS TR1 Regex Pin
David Crow27-Sep-11 15:48
David Crow27-Sep-11 15:48 
AnswerRe: MS TR1 Regex Pin
Peter_in_278027-Sep-11 16:17
professionalPeter_in_278027-Sep-11 16:17 
AnswerRe: MS TR1 Regex Pin
TenFiftyTwo27-Sep-11 23:11
TenFiftyTwo27-Sep-11 23:11 
QuestionRe: MS TR1 Regex Pin
David Crow28-Sep-11 2:22
David Crow28-Sep-11 2:22 
AnswerRe: MS TR1 Regex Pin
TenFiftyTwo28-Sep-11 3:22
TenFiftyTwo28-Sep-11 3:22 
AnswerRe: MS TR1 Regex Pin
Peter_in_278027-Sep-11 16:20
professionalPeter_in_278027-Sep-11 16:20 
QuestionDumb Question - Build Large CString Pin
jkirkerx27-Sep-11 9:23
professionaljkirkerx27-Sep-11 9:23 
AnswerRe: Dumb Question - Build Large CString Pin
TheGreatAndPowerfulOz27-Sep-11 9:53
TheGreatAndPowerfulOz27-Sep-11 9:53 
AnswerRe: Dumb Question - Build Large CString Pin
Albert Holguin27-Sep-11 9:54
professionalAlbert Holguin27-Sep-11 9:54 
GeneralRe: Dumb Question - Build Large CString Pin
Chuck O'Toole27-Sep-11 10:07
Chuck O'Toole27-Sep-11 10:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.