title: Erlang: why is my process still running after unregistering process ID?
body: <p>Even though I unregister <code>sts</code>, my spawned process is not stopped. How can I stop it not using gen_server?</p>
  
  <pre><code>start() -&gt;
    case whereis(sts) of
      undefined -&gt;
        PidA = spawn(dist_erlang, init,[]),
        register(sts, PidA),
        {ok,PidA};
      _ -&gt;
        {ok,whereis(sts)}
    end.
  
  stop() -&gt;
     case whereis(sts) of
       undefined -&gt; 
          already_stopped;
       _ -&gt;
          unregister(sts),
          stopped,
    end.
  </code></pre>