This section describes a typical way of using
Suppose a pool of "worker" processes is managed by a "manager" process. A process in the worker pool marks itself as available for work, and then calls process-stop. The manager process later finds a worker process that is marked as available for work, puts the work in a place known to the worker process, and then calls process-unstop on the worker process.
For this scheme to work properly, the check of whether the worker is available needs to include a call to
To guard against this possibility, then the manager should call process-stopped-p when finding the worker in the second step above. Alternatively, it could check the result of process-unstop.