Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Template Class: Problem with Header file Pin
«_Superman_»1-Feb-09 17:20
professional«_Superman_»1-Feb-09 17:20 
GeneralRe: Template Class: Problem with Header file Pin
gvanto1-Feb-09 17:52
gvanto1-Feb-09 17:52 
QuestionIs assignment to int atomic Pin
Dudi Avramov1-Feb-09 9:44
Dudi Avramov1-Feb-09 9:44 
AnswerRe: Is assignment to int atomic Pin
Alexander M.,1-Feb-09 9:49
Alexander M.,1-Feb-09 9:49 
QuestionRe: Is assignment to int atomic Pin
CPallini1-Feb-09 10:17
mveCPallini1-Feb-09 10:17 
AnswerRe: Is assignment to int atomic Pin
Joe Woodbury1-Feb-09 16:53
professionalJoe Woodbury1-Feb-09 16:53 
GeneralRe: Is assignment to int atomic Pin
Joe Woodbury1-Feb-09 16:52
professionalJoe Woodbury1-Feb-09 16:52 
AnswerRe: Is assignment to int atomic Pin
Randor 1-Feb-09 10:48
professional Randor 1-Feb-09 10:48 
Dudi Avramov wrote:
I'd like to know if the assignment operation to int (like int i; i=5; ) is atomic.


No, absolutely not. There is much more to atomic operations.

1.)The LOCK[^] prefix must be present to instruct the processor that it has exclusive memory access to the variable location.
2.) Modern processors perform speculative fetching and instruction reordering so the code being executed should be serialized before the atomic operaration with SFENCE[^]/LFENCE[^]/MFENCE[^] The volatile keyword[^] should give the compiler a hint that it needs to prevent out-of-order execution which may result in a Memory Barrier[^].

Interlocked Variable Access[^]
Synchronization and Multiprocessor Issues[^]

Best Wishes,
-David Delaune
GeneralRe: Is assignment to int atomic Pin
Dudi Avramov1-Feb-09 21:26
Dudi Avramov1-Feb-09 21:26 
GeneralRe: Is assignment to int atomic Pin
Stuart Dootson1-Feb-09 22:13
professionalStuart Dootson1-Feb-09 22:13 
Questiondecoding pdf format into device Pin
Horizzzon1-Feb-09 8:18
Horizzzon1-Feb-09 8:18 
AnswerRe: decoding pdf format into device Pin
CPallini1-Feb-09 10:23
mveCPallini1-Feb-09 10:23 
GeneralRe: decoding pdf format into device Pin
Horizzzon1-Feb-09 10:43
Horizzzon1-Feb-09 10:43 
QuestionStrncmp and GetwindowText problem Pin
keret1-Feb-09 6:18
keret1-Feb-09 6:18 
AnswerRe: Strncmp and GetwindowText problem Pin
Stephen Hewitt1-Feb-09 6:49
Stephen Hewitt1-Feb-09 6:49 
AnswerRe: Strncmp and GetwindowText problem Pin
Cedric Moonen1-Feb-09 7:31
Cedric Moonen1-Feb-09 7:31 
GeneralRe: Strncmp and GetwindowText problem Pin
keret1-Feb-09 8:38
keret1-Feb-09 8:38 
QuestionRe: Strncmp and GetwindowText problem Pin
David Crow2-Feb-09 5:55
David Crow2-Feb-09 5:55 
AnswerRe: Strncmp and GetwindowText problem Pin
keret2-Feb-09 6:54
keret2-Feb-09 6:54 
QuestionIs there any documents about vista's architecture? (brief one) Pin
followait1-Feb-09 4:09
followait1-Feb-09 4:09 
AnswerRe: Is there any documents about vista's architecture? (brief one) Pin
CPallini1-Feb-09 5:34
mveCPallini1-Feb-09 5:34 
GeneralRe: Is there any documents about vista's architecture? (brief one) Pin
followait1-Feb-09 15:39
followait1-Feb-09 15:39 
QuestionExcel Export document Pin
mohammadmot1-Feb-09 3:57
mohammadmot1-Feb-09 3:57 
AnswerRe: Excel Export document Pin
CPallini1-Feb-09 5:16
mveCPallini1-Feb-09 5:16 
QuestionNeed some help on how to use wget command in widows environment Pin
John5021-Feb-09 2:37
John5021-Feb-09 2:37 

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.