Click here to Skip to main content
15,919,479 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SetWindowText Pin
David Crow18-Oct-04 5:46
David Crow18-Oct-04 5:46 
GeneralRe: SetWindowText Pin
Vikram Kashyap19-Oct-04 2:49
Vikram Kashyap19-Oct-04 2:49 
GeneralRe: SetWindowText Pin
Vikram Kashyap19-Oct-04 2:50
Vikram Kashyap19-Oct-04 2:50 
Generalstory of winzip Pin
includeh1018-Oct-04 2:04
includeh1018-Oct-04 2:04 
GeneralRe: story of winzip Pin
22491718-Oct-04 2:21
22491718-Oct-04 2:21 
GeneralRe: story of winzip Pin
includeh1018-Oct-04 3:29
includeh1018-Oct-04 3:29 
GeneralRe: story of winzip Pin
includeh1018-Oct-04 3:56
includeh1018-Oct-04 3:56 
Question++ operator atomic? Pin
PeterHarrie18-Oct-04 1:53
PeterHarrie18-Oct-04 1:53 
Hi,

I am currently having a discussion at work.

If I have the following code:

int m_nNumber = 0;<br />
void Increase()<br />
{<br />
    m_nNumber++;<br />
}


Is this code threadsafe or should it be:

CCriticalSection m_cProtect;<br />
int m_nNumber = 0;<br />
void Increase()<br />
{<br />
    m_cProtect.Lock();<br />
    m_nNumber++;<br />
    m_cProtect.Unlock();<br />
}


In other words, will the ++ operator be called atomic (in one clockcycle).
Hope someone can help me.

Regards,
Peter.
AnswerRe: ++ operator atomic? Pin
Hans Ruck18-Oct-04 2:05
Hans Ruck18-Oct-04 2:05 
GeneralRe: ++ operator atomic? Pin
Antony M Kancidrowski18-Oct-04 2:07
Antony M Kancidrowski18-Oct-04 2:07 
AnswerRe: ++ operator atomic? Pin
Antony M Kancidrowski18-Oct-04 2:06
Antony M Kancidrowski18-Oct-04 2:06 
General&quot;const&quot; statement causes errors Pin
Vladimir Dubovoy18-Oct-04 1:25
Vladimir Dubovoy18-Oct-04 1:25 
GeneralRe: &quot;const&quot; statement causes errors Pin
Mad__18-Oct-04 1:33
Mad__18-Oct-04 1:33 
GeneralRe: &quot;const&quot; statement causes errors Pin
22491718-Oct-04 1:45
22491718-Oct-04 1:45 
GeneralRe: &quot;const&quot; statement causes errors Pin
Antony M Kancidrowski18-Oct-04 1:57
Antony M Kancidrowski18-Oct-04 1:57 
GeneralRe: &quot;const&quot; statement causes errors Pin
Vladimir Dubovoy18-Oct-04 3:18
Vladimir Dubovoy18-Oct-04 3:18 
GeneralRe: &quot;const&quot; statement causes errors Pin
Malcolm Smart18-Oct-04 11:05
Malcolm Smart18-Oct-04 11:05 
GeneralRe: &quot;const&quot; statement causes errors Pin
Vladimir Dubovoy18-Oct-04 19:34
Vladimir Dubovoy18-Oct-04 19:34 
GeneralRe: "const" statement causes errors Pin
yang7638762487-Apr-13 19:14
yang7638762487-Apr-13 19:14 
QuestionHow do I get Methods of a Dll File? Pin
pubududilena18-Oct-04 1:17
pubududilena18-Oct-04 1:17 
AnswerRe: How do I get Methods of a Dll File? Pin
22491718-Oct-04 1:52
22491718-Oct-04 1:52 
AnswerRe: How do I get Methods of a Dll File? Pin
Jim Crafton18-Oct-04 9:23
Jim Crafton18-Oct-04 9:23 
QuestionEdit box that copying and pasting? Pin
Dody_DK18-Oct-04 1:16
Dody_DK18-Oct-04 1:16 
AnswerRe: Edit box that copying and pasting? Pin
David Crow18-Oct-04 3:01
David Crow18-Oct-04 3:01 
GeneralRe: Edit box that copying and pasting? Pin
Dody_DK18-Oct-04 6:41
Dody_DK18-Oct-04 6:41 

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.