> This is just the classic atomic "test-and-set" operation, which may not > have a platform-independent expression... but on Win32 could be done with > > InterlockedBitTestAndSet(...) > > or possibly the more general > > InterlockedCompareExchange(...). > > In some cases, these are compiled as compiler "intrinsics" - avoiding > runtime OS/scheduler interaction. > > Other platforms typically have their own ways of performing these types > of operations. > > Of course, if you want it all done in the language... ;) > > Robert Roessler > [email protected]http://www.rftp.com
Yeah, I meant "no way to do that in portable c++" :). I don't know what syncronization primitives cryptopp is already using, but if there are mutexes or something else already they should be used I think. Initialization of singletons doesn't seem to be performance-critical enough to go for full lockless solution on all platforms just for its sake. :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. -~----------~----~----~----~------~----~------~--~---
