Atomic int api?

Any plans to provide an atomic integer api in SDL 1.3+?

Any plans to provide an atomic integer api in SDL 1.3+?

Just curious, why do you want one? We have a pretty good set of mutex
functions already.

	Bob PendletonOn Wed, 2006-08-30 at 18:36 -0400, Antonio SJ Musumeci wrote:

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

Hello !

Any plans to provide an atomic integer api in SDL 1.3+?

What is that ?

CU

It’s a typedef or similar, usually called atomic_t or something, that
corresponds to an integer that is guaranteed to be atomic WRT reads
and writes. That is, if one thread is writing values to it, there
should be no way that another thread reading it can end up getting
partially updated value. Used for read and write indices in lock-free
FIFOs and stuff like that.

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Thursday 31 August 2006 00:40, Torsten Giebl wrote:

Hello !

Any plans to provide an atomic integer api in SDL 1.3+?

What is that ?

Reference counting in a multi threaded environment. I’d think i’d be
useful in general.

Bob Pendleton wrote:> On Wed, 2006-08-30 at 18:36 -0400, Antonio SJ Musumeci wrote:

Any plans to provide an atomic integer api in SDL 1.3+?

Just curious, why do you want one? We have a pretty good set of mutex
functions already.

  Bob Pendleton

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Reference counting in a multi threaded environment. I’d think i’d be
useful in general.

Thank you. Yes, that would be a very nice thing to have.

	Bob PendletonOn Wed, 2006-08-30 at 18:56 -0400, Antonio SJ Musumeci wrote:

Bob Pendleton wrote:

On Wed, 2006-08-30 at 18:36 -0400, Antonio SJ Musumeci wrote:

Any plans to provide an atomic integer api in SDL 1.3+?

Just curious, why do you want one? We have a pretty good set of mutex
functions already.

  Bob Pendleton

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

It’s C++ (rather than SDL’s C), and currently only works on BSD, OS X,
Win32, and Linux x386, but:

http://g3d-cpp.cvs.sourceforge.net/g3d-cpp/cpp/source/include/G3D/AtomicInt32.h?view=markup

Perhaps something similar could be implemented in a more SDL way. I’m really
only familiar with the OS X stuff, as that’s the side I’m responsible for,
and we’re moving away from our SDL backend.

Cheers.
CaseyOn 8/30/06, Bob Pendleton wrote:

On Wed, 2006-08-30 at 18:56 -0400, Antonio SJ Musumeci wrote:

Reference counting in a multi threaded environment. I’d think i’d be
useful in general.

Thank you. Yes, that would be a very nice thing to have.

            Bob Pendleton

Bob Pendleton wrote:

On Wed, 2006-08-30 at 18:36 -0400, Antonio SJ Musumeci wrote:

Any plans to provide an atomic integer api in SDL 1.3+?

Just curious, why do you want one? We have a pretty good set of mutex
functions already.

GLIB also has an implementation but I’ve not checked to see what
platforms it supports.

Casey O’Donnell wrote:> It’s C++ (rather than SDL’s C), and currently only works on BSD, OS X,

Win32, and Linux x386, but:

http://g3d-cpp.cvs.sourceforge.net/g3d-cpp/cpp/source/include/G3D/AtomicInt32.h?view=markup
http://g3d-cpp.cvs.sourceforge.net/g3d-cpp/cpp/source/include/G3D/AtomicInt32.h?view=markup

Perhaps something similar could be implemented in a more SDL way. I’m
really only familiar with the OS X stuff, as that’s the side I’m
responsible for, and we’re moving away from our SDL backend.

Cheers.
Casey

On 8/30/06, Bob Pendleton <bob at pendleton.com <mailto:bob at pendleton.com>> wrote:

On Wed, 2006-08-30 at 18:56 -0400, Antonio SJ Musumeci wrote:
 > Reference counting in a multi threaded environment. I'd think i'd be
 > useful in general.

Thank you. Yes, that would be a very nice thing to have.

                Bob Pendleton

 >
 > Bob Pendleton wrote:
 > > On Wed, 2006-08-30 at 18:36 -0400, Antonio SJ Musumeci wrote:
 > >> Any plans to provide an atomic integer api in SDL 1.3+?
 > >
 > > Just curious, why do you want one? We have a pretty good set of
mutex
 > > functions already.
 > >


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Reference counting in a multi threaded environment. I’d think i’d be
useful in general.

Thank you. Yes, that would be a very nice thing to have.

  Bob Pendleton

BTW, it looks like a fairly simple project (famous last words :slight_smile: have
you considered just doing it and submitting it to Sam?

Bob PendletonOn Wed, 2006-08-30 at 21:38 -0500, Bob Pendleton wrote:

On Wed, 2006-08-30 at 18:56 -0400, Antonio SJ Musumeci wrote:

Bob Pendleton wrote:

On Wed, 2006-08-30 at 18:36 -0400, Antonio SJ Musumeci wrote:

Any plans to provide an atomic integer api in SDL 1.3+?

Just curious, why do you want one? We have a pretty good set of mutex
functions already.

  Bob Pendleton

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

Yes I have… was just asking first. I’ll throw something together when
I have some time.

Bob Pendleton wrote:> On Wed, 2006-08-30 at 21:38 -0500, Bob Pendleton wrote:

On Wed, 2006-08-30 at 18:56 -0400, Antonio SJ Musumeci wrote:

Reference counting in a multi threaded environment. I’d think i’d be
useful in general.
Thank you. Yes, that would be a very nice thing to have.

  Bob Pendleton

BTW, it looks like a fairly simple project (famous last words :slight_smile: have
you considered just doing it and submitting it to Sam?

Bob Pendleton

Bob Pendleton wrote:

On Wed, 2006-08-30 at 18:36 -0400, Antonio SJ Musumeci wrote:

Any plans to provide an atomic integer api in SDL 1.3+?
Just curious, why do you want one? We have a pretty good set of mutex
functions already.

  Bob Pendleton

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

If you want any help on the OS X side (the code I linked to should work on
OS X Intel and PPC), let me know.

CaseyOn 8/31/06, Antonio SJ Musumeci wrote:

Yes I have… was just asking first. I’ll throw something together when
I have some time.

Bob Pendleton wrote:

On Wed, 2006-08-30 at 21:38 -0500, Bob Pendleton wrote:

On Wed, 2006-08-30 at 18:56 -0400, Antonio SJ Musumeci wrote:

Reference counting in a multi threaded environment. I’d think i’d be
useful in general.
Thank you. Yes, that would be a very nice thing to have.

         Bob Pendleton

BTW, it looks like a fairly simple project (famous last words :slight_smile: have
you considered just doing it and submitting it to Sam?

  Bob Pendleton

Bob Pendleton wrote:

On Wed, 2006-08-30 at 18:36 -0400, Antonio SJ Musumeci wrote:

Any plans to provide an atomic integer api in SDL 1.3+?
Just curious, why do you want one? We have a pretty good set of mutex
functions already.

I’ve got most of it done… however I need to be able to know the
sizeof(void*) at compile time. For some reason I’m not able to get
AC_CHECK_SIZEOF(void*) to place SIZEOF_VOIDP into SDL_config.h. Is there
something I’m missing?