Since `Thread` objects are part of a big allocation, more than one
Thread could be on a single cache line, leading to false sharing. Atomic
updates to one `Thread` could then lead to poor performance accessing
another `Thread`. Align to CLS (cache line size) to avoid this.
}
#endif
+/* Aligned to CLS to avoid false sharing between atomic ops. */
typedef struct Thread_ {
ThreadVars *tv; /**< threadvars structure */
const char *name;
SCTime_t sys_sec_stamp; /**< timestamp in real system
* time when the pktts was last updated. */
SCSpinlock spin;
-} Thread;
+} __attribute__((aligned(CLS))) Thread;
typedef struct Threads_ {
Thread *threads;