[plt-scheme] custodian + process/ports

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Tue Jul 1 16:27:20 EDT 2008

Tom Schouten wrote:
> 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.
>>     
>
>   

To make it clear: custodian doesn't manage  subprocess. Sorry my first 
reply is not clear on this and is suggesting something that won't work.

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

Yes. Actually 'process and 'process/ports are all build on top of 
'subprocess.

> 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.
>
>   

I'm not sure what you are asking here.

> 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?)
>   

Try to take a look at the implementation of 'process. It's under 
mzlib/process.

Chongkai


Posted on the users mailing list.