Click here to Skip to main content
15,914,160 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: utyutyuytuutyutyutyuutyutyutyutyutyutyu/,.//,./, Pin
Cedric Moonen13-Jun-07 7:11
Cedric Moonen13-Jun-07 7:11 
QuestionDraw a cube Pin
gentleguy13-Jun-07 5:18
gentleguy13-Jun-07 5:18 
AnswerRe: Draw a cube Pin
Dustin Henry13-Jun-07 6:51
Dustin Henry13-Jun-07 6:51 
QuestionOnMouseMove HELP Please Pin
Charlie Curtis13-Jun-07 3:39
Charlie Curtis13-Jun-07 3:39 
AnswerRe: OnMouseMove HELP Please [modified] Pin
Mark Salsbery13-Jun-07 7:19
Mark Salsbery13-Jun-07 7:19 
QuestionC++ Thread Memory States/References Pin
Eshazear13-Jun-07 3:36
Eshazear13-Jun-07 3:36 
AnswerRe: C++ Thread Memory States/References Pin
James R. Twine13-Jun-07 3:46
James R. Twine13-Jun-07 3:46 
GeneralRe: C++ Thread Memory States/References Pin
Eshazear13-Jun-07 4:13
Eshazear13-Jun-07 4:13 
Thanks James,

Both of your answers solved the problem.

I'll probably resort to using the volatile qualifier.
After checking the documentation, I realized that both solutions you mentioned point to the same reason : optimization.

Here's what the documentation for the volatile qualifier said :
"Objects declared as volatile are not used in optimizations because their value can change at any time. The system always reads the current value of a volatile object at the point it is requested, even if the previous instruction asked for a value from the same object. Also, the value of the object is written immediately on assignment."

Incredible... I was never under the impression that optimizations performed such reckless(for lack of a better word :P) operations!
I was always under the misguided impression that changing the value of a member would be executed with immediate and accurate effect - almost feel like using the volatile qualifier on every single multi-threaded member that I use now!... Big Grin | :-D

Just another question though -
The documentation states : "The following example declares a volatile integer nVint whose value can be modified by external processes.... "
Does this imply that without the volatile keyword, that memory would otherwise be guarded against other processes trying to attempting to modify it?

Also (and only if you know off hand) - would you be able to point me in the direction of some good reading on this topic (optimal multi-threaded interaction)?
Thanks again.
GeneralRe: C++ Thread Memory States/References Pin
Roger Stoltz13-Jun-07 4:35
Roger Stoltz13-Jun-07 4:35 
GeneralMultithreaded aproaches Pin
Eshazear13-Jun-07 4:45
Eshazear13-Jun-07 4:45 
QuestionVolatile Array allocation on the heap? Pin
Eshazear14-Jun-07 1:33
Eshazear14-Jun-07 1:33 
QuestionNeed Help.. Pin
rajeevktripathi13-Jun-07 3:12
rajeevktripathi13-Jun-07 3:12 
QuestionRe: Need Help.. Pin
Hamid_RT13-Jun-07 3:20
Hamid_RT13-Jun-07 3:20 
AnswerRe: Need Help.. Pin
Hamid_RT13-Jun-07 3:24
Hamid_RT13-Jun-07 3:24 
GeneralRe: Need Help.. Pin
rajeevktripathi13-Jun-07 19:23
rajeevktripathi13-Jun-07 19:23 
QuestionRe: Need Help.. Pin
Hamid_RT13-Jun-07 20:57
Hamid_RT13-Jun-07 20:57 
GeneralRe: Need Help.. Pin
rajeevktripathi14-Jun-07 1:26
rajeevktripathi14-Jun-07 1:26 
QuestionNeed Help.... Pin
rajeevktripathi13-Jun-07 3:11
rajeevktripathi13-Jun-07 3:11 
AnswerRe: Need Help.... Pin
James R. Twine13-Jun-07 3:25
James R. Twine13-Jun-07 3:25 
GeneralRe: Need Help.... Pin
rajeevktripathi13-Jun-07 19:21
rajeevktripathi13-Jun-07 19:21 
AnswerRe: Need Help.... Pin
Programm3r13-Jun-07 4:18
Programm3r13-Jun-07 4:18 
QuestionShowing/hiding Groups of controls Pin
softwaremonkey13-Jun-07 2:47
softwaremonkey13-Jun-07 2:47 
AnswerRe: Showing/hiding Groups of controls Pin
Hamid_RT13-Jun-07 3:17
Hamid_RT13-Jun-07 3:17 
AnswerRe: Showing/hiding Groups of controls Pin
James R. Twine13-Jun-07 3:19
James R. Twine13-Jun-07 3:19 
GeneralRe: Showing/hiding Groups of controls Pin
softwaremonkey13-Jun-07 4:48
softwaremonkey13-Jun-07 4:48 

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.