title: Establishing Data Consistency
body: <p>I have a fixed size FIFO type array to store newly added datas. In my main function this array keeps updating itself continuously and one thread working on this data. I want my thread to work on latest passed data to itself meanwhile main function keeps updating it. In the code below, I tried to demonstrate what I am trying to explain. Thread 1 includes a while(1) function itself as well. The reason I am updating Queue on main thread, because Thread 1 has a sleep duration. It may has a simple answer, however my brain currently stopped working.</p>
  
  <pre><code>int main(){
  pthread_create(Thread1);
  while(1) {
  QueuePut(Some_Value);
  arguments_of_Thread1.input = Queue;
  ...
  }
  return 0;
  </code></pre>