title: efficient use of NUMA architecture
body: <p>I'm writing a multithreaded java program that uses intensive CPU and memory usage.
  The goal of the program is to execute some algorithm on a graph. The program is executed on a NUMA machine running linux and I'd like to get the best possible performance of that.</p>
  
  <p>For this I make a number of copies of the graph per each NUMA-node, so that each thread would be able to access the graph on a local memory. </p>
  
  <p>The part of local memory allocations is already done by setting affinity before allocating each new copy of the graph. This is done with jna, so I prefer to stay with this library and not to add jni code, if it is possible.</p>
  
  <p>My question is how can I check on which core a worker thread is running in order to make the reads from the local memory?</p>
  
  <p>I understand that the thread-to-core binding could change during the execution. However, the kernel tries to run the thread on the same NUMA-node at all time-slices. Therefore checking, only in the beginning, on which core the thread is running would work for most of the cases.</p>