Hi Robert,
On Tuesday 16 January 2007 13:48, Robert Osfield wrote:
> On 1/16/07, Mathias Froehlich <[EMAIL PROTECTED]> wrote:
> > And at least on MSVC and gcc >= 4.1 there are compiler builtin functions
> > to do atomic counts.
> > With that knowledge the compiler can probably even optimize successive
> > ref/unref pairs away under some circumstances ...
>
> Do you have a links to information on this?
Hmm, I have even beginnings of an implementation for osg on my local disc at
home :)
Also, one free implementation using that stuff is in SimGear - a base lib of
flightgear - www.simgear.org, SGAtomic.*. There is an implementation that
uses either those two builtins if available or a plain mutex otherwise.
The functions in MSVC are InterlockedIncrement for example, you will find
documentation in MSDN about that.
The one gcc intrinsic is named __sync_add_and_fetch for example. Documented in
the gcc info file.
BTW the gcc intrinsics are derived from some functions originally defined for
the ia64 abi. May be other compilers support them as well ...
Well, I believe the easiest way would be for me to finish that implementation
that I have already started ...
Greetings
Mathias
--
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/