On Wed, Dec 09, 2015 at 09:27:16AM +1000, Paul Dale wrote: > It will be possible to support atomics in such a way that there is no > performance penalty for machines without them or for single threaded > operation. My sketcy design is along the lines of adding a new API > CRYPTO_add_atomic that takes the same arguments as CRYPTO_add (i.e. > reference to counter, value to add and lock to use): > > CRYPTO_add_atomic(int *addr, int amount, int lock) > if have-atomics then > atomic_add(addr, amount) > else if (lock == have-lock-already) > *addr += amount > else > CRYPTO_add(addr, amount, lock)
"have-atomics" must be known at compile time. "lock" should not be needed because we should always have atomics, even when we don't have true atomics: just use a global lock in a stub implementation of atomic_add() and such. KISS. Besides, this will add pressure to add true atomics wherever they are truly needed. Nico -- _______________________________________________ openssl-dev mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev