Click here to Skip to main content
15,900,818 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: AT command? ===> read sms method Pin
jmkhael26-Aug-04 1:00
jmkhael26-Aug-04 1:00 
GeneralRe: AT command? ===> read sms method Pin
Adrian Soon26-Aug-04 2:06
Adrian Soon26-Aug-04 2:06 
GeneralRe: AT command? ===> read sms method Pin
Adrian Soon28-Aug-04 5:18
Adrian Soon28-Aug-04 5:18 
Generalintrinsic _InterlockedIncrement Pin
peterchen25-Aug-04 5:10
peterchen25-Aug-04 5:10 
GeneralRe: intrinsic _InterlockedIncrement Pin
jmkhael25-Aug-04 5:21
jmkhael25-Aug-04 5:21 
GeneralRe: intrinsic _InterlockedIncrement Pin
peterchen25-Aug-04 6:43
peterchen25-Aug-04 6:43 
GeneralRe: intrinsic _InterlockedIncrement Pin
jmkhael25-Aug-04 6:59
jmkhael25-Aug-04 6:59 
GeneralRe: intrinsic _InterlockedIncrement Pin
peterchen25-Aug-04 13:30
peterchen25-Aug-04 13:30 
My question was just this:
the intrinsic form is documented for VC7, but not for VC6, however, it seems to work on VC6. Are there any known reasons why it wasn't documented? Or any known problems using it with VC6? (might be the optimizer barfing in some cases, or whatever)

Papa wrote:
What i would like to understand, is, what gain you get if you use the intrinsic form?

possible optimizations, since the function can be inlined:
- no function call, stack frame etc.
- this pointer likely in register
- unused return value optimization (the inc eax)
- reuse of a register known to hold the value 1
- better pairing ofthe staements (esp. the lock xadd)

Assuming the this pointer is already in eax, and we are not interested in the return value, the emitted code for InterlockedIncrement(&m_count) falls down to two instructions:
<br />
mov ecx, 1<br />
lock xadd [eax + offset m_count], ecx<br />


Now admittedly the "lock" is pretty much a showstopper and will amount the biggest performance hit. I guess I just pefer a few inlined instructions over a call into kernel32.dll Roll eyes | :rolleyes:


we are here to help each other get through this thing, whatever it is Vonnegut jr.

sighist || Agile Programming | doxygen

GeneralCFile - changing bytes Pin
BlackDice25-Aug-04 4:18
BlackDice25-Aug-04 4:18 
GeneralRe: CFile - changing bytes Pin
jmkhael25-Aug-04 4:27
jmkhael25-Aug-04 4:27 
GeneralRe: CFile - changing bytes Pin
David Crow25-Aug-04 5:52
David Crow25-Aug-04 5:52 
GeneralRe: CFile - changing bytes Pin
BlackDice25-Aug-04 12:01
BlackDice25-Aug-04 12:01 
GeneralRe: CFile - changing bytes Pin
David Crow25-Aug-04 12:04
David Crow25-Aug-04 12:04 
GeneralCListCtrl question Pin
Shay Harel25-Aug-04 4:13
Shay Harel25-Aug-04 4:13 
GeneralRe: CListCtrl question Pin
David Crow25-Aug-04 5:49
David Crow25-Aug-04 5:49 
GeneralRe: CListCtrl question Pin
Shay Harel25-Aug-04 5:52
Shay Harel25-Aug-04 5:52 
GeneralRe: CListCtrl question Pin
David Crow26-Aug-04 3:17
David Crow26-Aug-04 3:17 
GeneralWindows XP Theme Colour Scheme Pin
Steve Thresher25-Aug-04 4:07
Steve Thresher25-Aug-04 4:07 
GeneralRe: Windows XP Theme Colour Scheme Pin
Anonymous25-Aug-04 5:21
Anonymous25-Aug-04 5:21 
GeneralCRecordset Record Updating(Debug Assertion Failure) problem Pin
raed25-Aug-04 4:03
raed25-Aug-04 4:03 
GeneralRe: CRecordset Record Updating(Debug Assertion Failure) problem Pin
jmkhael25-Aug-04 4:43
jmkhael25-Aug-04 4:43 
Generalcocreateinstance and windows media player Pin
Scozturk25-Aug-04 3:50
professionalScozturk25-Aug-04 3:50 
GeneralRe: cocreateinstance and windows media player Pin
Michael P Butler25-Aug-04 4:15
Michael P Butler25-Aug-04 4:15 
GeneralRe: cocreateinstance and windows media player Pin
Scozturk25-Aug-04 6:19
professionalScozturk25-Aug-04 6:19 
GeneralRe: cocreateinstance and windows media player Pin
Michael Dunn25-Aug-04 7:35
sitebuilderMichael Dunn25-Aug-04 7:35 

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.