The correct operation of this queue relies on the
fact that at most one thread in the system will wait
for a particular process to exit. The reason for
this restriction is that Unix semantics only allow us to
perform a waitpid() once
for a given process id. VMProcess uses Java synchronization
to enforce this property.
Note that a strange issue arises on Linux: it is only possible
to wait for a child process to exit from the pthread that forked
the process. (This due to the threading model used by Linux, where
pthreads have some characteristics of processes.)
Because of this limitation, in order for a Java thread to wait for
a process to exit, it must migrate to the Processor
that created the process. A ProcessorLock
in the virtual processor object protects access to this queue, since it
may be accessed from another Processor.
When polling for exited processes, we have to be careful to ignore
GreenThreads that are still being dispatched on another
I would imagine that AIX pthreads work correctly with respect to
allowing arbitrary pthreads to perform a waitpid().