SDL_atomic progress report and request for help

I’ve written a brief description of the current library and my reasons
for making it the way it is on my blog at
http://thegrumpyprogrammer.com/node/14 I need helpers to work on the
Windows and Mac versions and if you have a favorite platform I need
your help too. I have written a Linux version and a dummy version that
you can work form. But, I do not have a Mac or Windows development
environment so I am rather stuck on getting those done. I can provide
guidance, and I will check in your code. You can find the code in
/src/atomic/…

Bob Pendleton–
±----------------------------------------------------------

Bob,

MSVC at least provides compiler intrinsics for some of those. I’d bet
that mingw also provides them as intrinsics or runtime functions.
However, as I’m not at all familiar with atomic operations, I’m not
quite sure on the difference between things like CompareThenSet and
TestThenSet or FetchThenIncrement and IncrementThenFetch. If I were I’d
be more than happy to lend a hand with this, as I know the
benefits to fast userspace synchronization.

However, maybe the MSDN documentation on these functions could provide
some assistance: http://msdn.microsoft.com/en-us/library/5704bbxw.aspx
If you could explain the difference between those, maybe I could provide
some help on Windows. But otherwise I’d only be able to fill in a handful.

Bob,

MSVC at least provides compiler intrinsics for some of those. I’d bet that
mingw also provides them as intrinsics or runtime functions.

Yep.

However, as I’m not at all familiar with atomic operations, I’m not quite
sure on the difference between things like CompareThenSet and
TestThenSet or FetchThenIncrement and IncrementThenFetch. If I were I’d be
more than happy to lend a hand with this, as I know the
benefits to fast userspace synchronization.

I’ve been writing that up in part 2 of my blog on the subject. I’ll
post again when I have that finished.

Bob PendletonOn Wed, Jul 8, 2009 at 7:20 PM, Nate Fries wrote:

However, maybe the MSDN documentation on these functions could provide some
assistance: http://msdn.microsoft.com/en-us/library/5704bbxw.aspx
If you could explain the difference between those, maybe I could provide
some help on Windows. But otherwise I’d only be able to fill in a handful.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------

Bob,

MSVC at least provides compiler intrinsics for some of those. I’d bet
that
mingw also provides them as intrinsics or runtime functions.

Yep.

However, as I’m not at all familiar with atomic operations, I’m not quite
sure on the difference between things like CompareThenSet and
TestThenSet or FetchThenIncrement and IncrementThenFetch. If I were I’d
be
more than happy to lend a hand with this, as I know the
benefits to fast userspace synchronization.

I’ve been writing that up in part 2 of my blog on the subject. I’ll
post again when I have that finished.

Are the gcc extensions similar on mac/mingw?

Might be good to collect a list or urls for each platform.

eg:
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.html

Apparently those are also used by the ICC compiler. So just supporting them
should give you very high portability already.

here’s the OSX page:

http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/OSAtomicIncrement32Barrier.3.html

Also a list of urls for atomic operations libraries could be useful. So
people can look at them for ideas, and even use for testing.

cheers,On Fri, Jul 10, 2009 at 6:50 AM, Bob Pendleton wrote:

On Wed, Jul 8, 2009 at 7:20 PM, Nate Fries wrote: