define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES

From liblfds.org
Revision as of 05:55, 14 December 2015 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source File

└───liblfds700
    └───inc
        └───liblfds700
                lfds700_lfds700_porting_abstraction_layer_processor.h

Define

#define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES  [on CAS platforms, cache line length in bytes; on LL/SC platforms, larger of cache line length and ERG length, in bytes]

Example

#define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES  2048

Optionality

This define is mandatory and the library cannot compile if it is not set.

Notes

Please see Alignment_and_Padding_of_Atomic_Variables.

All atomic variables in liblfds are aligned and padded to the value of LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES.

This define is set to the larger of the cache-line size in bytes and, if present on the processor, the exclusive reservation granule size in bytes.

Only a few processors (ARM and POWERPC) provide exclusive reservation granules, so for most processors this define is simply set to the cache line width.

(On LL/SC processors which do not use granules, but have per-processor monitors, this define is set to the cache-line size).

If this value is incorrectly set, the consequence is a reduction (possibly large or very large) in performance. Also, on platforms which use LL/SC and have an exclusive reservation granule (ARM and POWERPC), structure sizes can become very large, and unnecessarily so.

For example, on ARM, the worst case value (which is the value used in the ARM port, to ensure it works on all platforms) is 2048 bytes, but the usual value is something more like 32 bytes. The btree element structure has, for example, three atomic variables - which makes it in the worst case (along with its other variables) a bit larger than six kilobytes PER ELEMENT.

See Also