title: The program shown over uses the Pthreads API. What would be the output from the program at LINE C and LINE P?
body: <pre><code>int value = 0;
  void *runner(void *param); /* the thread */
  
  int main(int argc, char *argv[])
  {
      pid_t pid;
      pthread_t tid;
      pthread_attr_t attr;
  
      pid = fork();
  
      if (pid == 0)  /* child process */
      { 
          pthread_attr_init(&amp;attr);
          pthread_create(&amp;tid,&amp;attr,runner,NULL);
          pthread_join(tid,NULL);
          printf("CHILD: value = %d\n",value); /* LINE C */
      } 
      else if (pid &gt; 0)  /* parent process */
      {
           wait(NULL);
           printf("PARENT: value = %d\n",value); /* LINE P */
      }
  }
  
  void* runner(void* param) 
  { 
      value = 5;
      pthread_exit(0);
  }
  </code></pre>
  
  <p>Is the value at LINE C = 5 and at LINE P = 0. But why is this? I'm thinking it's because the child process is a copy of the parent process but anything that changes in the child process doesn't necessarily change in the parent process. </p>
  
  <p>In the child process the runner thread is invoked and this thread changes the value to 5 and then prints it out.</p>
  
  <p>When the child is finished the parent process then prints out 0 because no operations were performed on this value. Is this correct? </p>