Hi,

I have now committed a patch to our reference counter that will make reference 
counting thread safe.
As far as I could test or have testers, this patch uses gcc's or MSVC's atomic 
compiler intrinsics for that task. IMO that is actually the least intrusive 
way to ensure thread safety. I hope that these compilers also know much about 
that builtin functions to do some optimizations with them.

For *all* other architectures this falls back to using mutexes which is quite 
heavyweight for that task. That means it will work, but probably not really 
fast.

I believe that I have covered the most important architectures/compilers with 
win32 and gcc i386/x86_64. But the next important ones from my point of view 
are the ppc/macos X and the IRIX versions.
I believe that these also have some intrinsics or assembly instructions that 
guarantee atomic changes to an (unsigned) int value, but I have no macos 
machine present.

So If anybody knows how to do that for his favourite architecture, feel free 
to provide patches/check that in ...

    Greetings

        Mathias

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to