[plt-scheme] custodian + process/ports

From: Tom Schouten (tom at zwizwa.be)
Date: Tue Jul 1 16:19:03 EDT 2008

On Tue, Jul 01, 2008 at 01:43:54PM -0600, Chongkai Zhu wrote:
> As the doc says, 'process/ports executes a shell command asynchronously,  
> which means is is not under the control of custodian. It seems that you  
> need to use 'subprocess instead of 'process/ports to get subprocess  
> value, and then use 'subprocess-kill to kill it.

'subprocess also executes asynchronously, which i thought to mean
"doesn't wait until process termination to return".

Using process/ports the custodian does seem to close the ports, it just doesn't
collect the return value of the process producing a zombie. Your suggested 
method works, but what i don't understand is why the 'close method of the port 
created by 'make-output-port doesn't get called by 'custodian-shutdown-all.

Then another question: what is the difference between the process and subprocess 
procedures? (maybe the question is really: What's the difference between 
ordinary ports and file ports wrt. custodians?)

Posted on the users mailing list.