title: Is there any difference between "mutex" and "atomic operation"?
body: <p>I'm learning Operating System now, and I'm quite confused with the two concepts - <strong>mutex</strong> and <strong>atomic operation</strong>. In my understanding, they are the same, but my OS instructor gave us such a question,</p>
  
  <blockquote>
    <p>Suppose a multi-processor operating system kernel tracks the number of processes created by each user. This operating system kernel maintains a counter variable for each user that it increments every time it creates a new process for a user and decrements every time a process from that user terminates. Furthermore, this operating system runs on a processor that provides atomic fetch-and-increment and fetch-and-decrement instructions.
    Should the operating system update the counter using the atomic increment and decrement instructions, or should it update the counter in a critical section protected by a mutex? </p>
  </blockquote>
  
  <p>This question indicates that mutex and atomic operation are two things. Could anyone help me with it?</p>