Bug 43793 - builtin atomics on Windows
Summary: builtin atomics on Windows
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-11-04 23:38 UTC by Takashi Sato
Modified: 2007-11-05 00:02 UTC (History)
0 users



Attachments
against trunk (4.67 KB, patch)
2007-11-05 00:02 UTC, Takashi Sato
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Sato 2007-11-04 23:38:54 UTC
http://msdn2.microsoft.com/en-us/library/26td21ds(vs.71).aspx
VC++ 7.1 has
_InterlockedCompareExchange 
_InterlockedDecrement 
_InterlockedExchange 
_InterlockedExchangeAdd 
_InterlockedIncrement 

I'm not sure if compilers prior to 7.1 have them.

http://msdn2.microsoft.com/en-us/library/wt813x6k(VS.80).aspx
on x86_64 and Itanium VC++ 8 has
_InterlockedExchangePointer
_InterlockedCompareExchangePointer

These are more useful than atomics of Win32API because:

1) faster
2) They accept both singed and unsigned variable acceptable, 
so there's no need to use casts.
Comment 1 Takashi Sato 2007-11-05 00:02:02 UTC
Created attachment 21085 [details]
against trunk

I left IA64 and x86_64 apr_atomic_casptr and apr_atomic_xchgptr untouched