Parent Directory | Revision Log
Links to HEAD: | (view) (download) (as text) (annotate) |
Sticky Revision: |
ncbi_atomic_defs.h: Fully acknowledge ARM64 assembly availability. JIRA: CXX-11589.
ncbi_atomic_defs.h: Reformat lengthy NCBI_SWAP_POINTERS_EXTERN condition. JIRA: CXX-11589.
Implement atomic operations for 64-bit ARM (__aarch64__). Use one-shot ARMv8.1+ atomic extensions (swpal, ldaddal) when targeting a suitable processor at compile time; otherwise, stick with ldxr/stlxr-based loops. JIRA: CXX-11589.
ncbicntr.hpp, ncbi_atomic_defs.h: Formally tweak preprocessor directives. - ncbicntr.hpp: Properly indent a nested #endif. - ncbi_atomic_defs.h: Correct parenthesization of NCBI_COUNTER_USE_ASM's requirements; clean up a 32-bit-SPARC special case that's now clearly redundant.
CAtomicCounter: Permit copying even when based on std::atomic<>. To that end, force automatic generation of a default constructor in this scenario. JIRA: CXX-11589.
Distinguish GCC, Apple Clang, and LLVM Clang. - Use distinct NCBI_COMPILER_APPLE_CLANG and NCBI_COMPILER_LLVM_CLANG macros (albeit with a convenience NCBI_COMPILER_ANY_CLANG macro) due to fully independent version numbering. - Adjust NCBI_COMPILER_GCC conditionalizations accordingly, taking the opportunity to account for the fact that we require GCC 5.x or newer nowadays for C++14 support. (As for the remaining, generally unversioned, conditionalizations, some should perhaps also cover NCBI_COMPILER_ICC, but ICC builds have been doing fine as is.) - Introduce a central NCBI_UNUSED macro, defined based on clean introspection (NCBI_HAS_CPP_ATTRIBUTE, falling back on GCC __has_attribute before bailing to allow for use from C) rather than compiler identification. - Likewise use introspection for nc_utils.hpp's private ATTR_PACKED and ATTR_ALIGNED_8 macros, favoring C++14 [[...]] syntax. (Fallback to legacy GCC syntax shouldn't be necessary here, but remains present for now just in case.) JIRA: CXX-10982.
ncbi_atomic_defs.h: Don't try to #include <atomic> under MSVC; its std::atomic<> has a non-default constructor, so MT-safe initialization could be problematic, and even including the header yields an error in "managed" (CLR) mode. JIRA: GP-17609.
MSVC 2013 implements std::atomic<> with non-default constructor, so it cannot be statically initialized in a MT-safe manner.
ncbi_atomic_defs.h: In single-threaded builds and multithreaded builds using C++11 std::atomic, use size_t for TNCBIAtomicValue, and define NCBI_COUNTER_64_BIT when it turns out to be a 64-bit type. JIRA: CXX-5828.
Added 64-bit atomic counter where possible - currently GCC/ICC/MSVC on Interl x64. Moved non API CObject counter constant from header to cpp. Added comments. JIRA: CXX-5828
ncbi_atomic_defs.h: Always assess the standard C++'s library version by including <cstdlib> rather than trying to guess whether GNU libstdc++'s <bits/c++config.h> is available. JIRA: CXX-3820, CXX-4913.
ncbi_atomic_defs.h: Revert accidental logic change that resulted in favoring C++ '11 <atomic> over inline assembly. JIRA: CXX-3707.
Favor standard C++ '11 <atomic> over GNU extensions. JIRA: CXX-3707.
Rework central C++ Toolkit configuration headers' relationships, so that <ncbiconf.h> pulls in <common/ncbiconf_impl.h>; move the #include directive for <common/ncbi_skew_guard.h> to the latter.
Check for __powerpc__ and __powerpc64__ in addition to __ppc__ and __ppc64__, as the symbol name varies between Darwin and Linux.
Disable use of Darwin-specific functions, which come from the deprecated CarbonCore framework; we have assembly versions available, and can generally also use GCC's __exchange_and_add. JIRA: CXX-2110.
When building with ICC, favor inline assembly over __exchange_and_add even if __GLIBCXX__ happened to have been defined, modulo the usual exception for --with-tcheck configurations.
Work around an optimizer bug observed when building PowerPC binaries with GCC 4.2 on Mac OS X (Darwin) by forcing use of AddAtomic rather than __gnu_cxx::exchange_and_add. JIRA: CXX-1469.
Conditionalize directly on libstdc++ version (when relevant) rather than G++ version, which may not always correlate. (In particular, accommodate Mac OS X 10.6, which features a G++ 4.2 installation configured to use libstdc++ 4.0.).
Implement a new --with-tcheck flag to optimize build settings for use with Intel's thread checker. JIRA: CXX-1153.
Purge NCBI_OS_MAC code branches. JIRA: CXX-877
Factor out unrelated (but historically dislocated) configuration macros out of ncbitype.h
Actually enable use of SwitchToThread on Windows. (The previous preprocessor conditionals were slightly off.).
Renamed NCBI_SCHED_[YIELD|INIT] -> NCBI_SCHED_SPIN_[YIELD|INIT] macro and use it in atomic functions. Added NCBI_SCHED_YIELD implementation without spin lock, added implementation for MS-Windows. JIRA: CXX-835
* Per Eugene Vasilchenko's suggestion, favor inline assembly for NCBI_COUNTER_ADD over standard library calls as function-call overhead can be appreciable, particularly on x86. * Always define NCBI_COUNTER_RESERVED_VALUE when using hand-rolled 32-bit Sparc assembly. (One refactoring a while ago accidentally had the side effect of doing so only for GCC builds.)
Always use InterlockedExchangePointer for NCBI_SWAP_POINTERS on NCBI_OS_MSWIN, as it merely requires MSVC 7 or newer. JIRA: CXX-286
Fix multithreaded builds with GCC 4.2 and up, which place atomicity.h in ext/ rather than bits/ (thereby officially allowing its public use).
Fixed svn properties in trunk/c++.
Added missed ')' to NCBI_SWAP_POINTERS declaration on WIN64
Fix a logic error that gave libxncbi an extraneous (and suboptimal!) definition of NCBI_SwapPointers in some configurations.
Split <corelib/ncbi_os_mswin.hpp> onto "C" and "C++" parts
Readjust once more, for multithreaded WorkShop configurations w/o atomic.h.
Make it clear that (Solaris's) atomic_swap_ptr is a C function.
Compensate for versions of Solaris 10 that neglect to declare atomic_swap_ptr.
Use C-style casts throughout.
Fix minor errors in previous revision.
Refactor, making SwapPointers available to pure C code.
Support multithreaded x86-64 WorkShop configurations.
CVS $Log$ keyword clean-up: everything except "internal".
Attempt to remove "verify" kludge -- since "verify" has been moved away
Rolled back accidental commit.
Explicit specialization of operator<< for FManip.
fix verify def under DARWIN
Remove unneeded export specifier for CAtomicCounter - the class is entirely inline for MSVC
GCC 3.4 has moved __exchange_and_add to the __gnu_cxx namespace. Split up "+m" constraints for GCC assembly, as versions 3.4 and up complain about them.
Added spin counter before calling sched_yield(). Use volatile version of pointer for assignment in x_Add().
Clean up after previous (mislogged) commit, and honor volatility better.
moved core/settings.[ch]pp and core/system_path.[ch]pp to config and utils, respectively.
Centralize undefinition of Darwin's check macro.
Darwin: include the master CoreServices header because DriverSynchronization.h is officially internal.
Documentation changes.
wrap includes of sched.h (explicit and implicit) in extern "c" blocks, since Apples headers do not do it themselves.
OS_DARWIN's AddAtomic returns the previous value, not the incremented value as we require.
proper definitions for NCBI_COUNTER_ADD on Mac/Darwin
Added doxygen support
Make CObject a friend, so that InitCounter can read m_Value directly rather than going through Get(), which would end up spinning forever if it came across NCBI_COUNTER_RESERVED_VALUE.
Added export specifier for building DLLs in windows. Added global list of all such specifiers in mswin_exports.hpp, included through ncbistl.hpp
Enable inline asm for ICC 6, which seems to be okay with our (modern) syntax.
Fixed volatile argument to NCBI_COUNTER_ADD
Safe initialization of static mutexes
Use <corelib/ncbi_os_mswin.hpp> in the place of <windows.h>
exceptions replaced by CNcbiException-type ones
+CMutableAtomicCounter
Use trivial implementation for single-threaded builds.
Inline assembly leads to ICC compiler errors in some cases, so stop defining NCBI_COUNTER_ASM_OK for ICC.
Fix Intel extended assembly. Drop use of FreeBSD <machine/atomic.h>; those functions return void. Fix name of "nv_value_p" in Add(), and declare it only when needed.
Use low-level atomic operations for reference counts
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
NCBI Systems Team">NCBI Systems Team | ViewVC Help |
Powered by ViewVC 1.1.20 |