[Insight-developers] type of modification time
Sean McBride
sean at rogue-research.com
Mon Sep 24 13:42:05 EDT 2012
On Mon, 24 Sep 2012 14:43:03 +0000, Matt McCormick said:
>The type of the modified time is limited by the platform-specific
>functions to perform the atomic operation that increments it. We are
>limited to the type used in the platform specific functions, and I do
>not think what you are proposing will work (although I would be happy
>to be proved wrong :-) ).
Indeed, it may be tricky for that reason.
Also, on OS X, the OSAtomicIncrement64() function is available on 64 bit PowerPC, but not 32 bit PowerPC... OSAtomicIncrement32 is available on both, which is what is used now. We could always fall back to the slow mutex on PPC32 I guess.
One portable thing that could be done is to use C++11's new atomic stuff, and fall back to the platform-specific code only if the compiler does not support C++11. Few compilers support it yet, but it's more future-proof.
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng sean at rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
More information about the Insight-developers
mailing list