A process is like any other object. If it is not reachable from a
global (including Processor) then it will be garbage collected. A
process is only held by Processor when it is running or ready to run.
Otherwise, it is terminated, suspended, or waiting on a semaphore, and
is free from any globals, and thus can be garbage collected. When
waiting on a semaphore, the semaphore itself holds the process, so the
process can be GCed only if the semaphore can also be GCed. So, in
your example above, if the SharedQueue (which holds the semaphore) is
free to be GCed then the process waiting on it will be free to be GCed
as well (if nothing else is holding it back). So you should be ok.