Annotation Type CacheLinePad


@Retention(RUNTIME) @Target(FIELD) public @interface CacheLinePad
When this annotation is used on a field, automatic cache-line-sized padding will be inserted around the field. This is useful in multi-threaded algorithms to avoid cache line false sharing. The annotation defaults to padding after the field, but can be changed to before or both before and after. It can be applied to both mapped object fields and POJO primitive fields.
Author:
Spasi
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    When true, cache-line padding will be inserted after the field.
    boolean
    When true, cache-line padding will be inserted before the field.
  • Element Details

    • before

      boolean before
      When true, cache-line padding will be inserted before the field.
      Returns:
      true if cache-line padding will be inserted before the field
      Default:
      false
    • after

      boolean after
      When true, cache-line padding will be inserted after the field.
      Returns:
      true if cache-line padding will be inserted after the field
      Default:
      true