fstpackage / fstlib

A C++ library for lightning fast multi-threaded serialization of tabular data. Home to the `fst` file format.
Mozilla Public License 2.0
37 stars 9 forks source link

Scan multi-threaded code for false sharing #6

Open MarcusKlik opened 6 years ago

MarcusKlik commented 6 years ago

See for example here. To lower memory requirements, fstlib allocates larger blocks of memory that are written to by several threads. In such cases, cache line pollution must be avoided.

A solution is to make sure each sub-block has a size that is a multiple of the cache line size (64 bytes on most modern Intel processors).