I am trying to understand False sharing and cache alignment and its impact on performance on Multi core systems.Here is my case and I am trying to understand at the very high level.
Threads : 2
CPUS/Cores : 4
Locks : 1 per each Thread T1, T2
Data Structures : Each thread has 32k Size Structure which has several nested arrays and structures.
Language : C
I have 2 threads and 4 cores/CPU that can service the 2 threads at any given time.Now my threads continuously deal with writing and reading their respective data structures which are fairly large close to 32K size. Each threads are independent of each other and do not write/read Data structures of other threads.Threads always held a lock starting of their time slice.
Given my above case, are there any chances of false sharing or any negative impact that can hinder the performance. I assume there wouldnt be any false sharing since each thread works on their own data Structure and takes a lock at the very beginning of thread time slice.