[erlang-questions] open_port and port_close semantics

Camille Troillard <>
Fri May 1 02:35:53 CEST 2009


Hi Dave,
Strangely enough I though it was killing my process but after some usage, I
found it was not true, at least in my application.  I will implement a
shutdown message which seems totally right regarding resource cleanup.


Cam

On Thu, Apr 30, 2009 at 3:53 PM, Dave Bryson <> wrote:

>
> I'm pretty sure 'port_close' sends an exit signal to the child process
> (have not confirmed from src) .  At least in my application it kills the
> child process.  However in most cases I'll send my own stop message to the
> child process and have it call exit on itself so it can do any clean-up
> necessary.
>
> Dave
>
>
> On Apr 30, 2009, at 5:50 AM, Camille Troillard wrote:
>
>  Hello,
>>
>> I am trying to understand the semantics of open_port and port_close.
>> I was expecting port_close to send a quit signal to the child process, but
>> it merely close the file handlers from what I've read in the doc and
>> trapexit forums.
>>
>> What is the reason behind this?
>> How do you make sure there are no leftover processes when the application
>> shuts down?
>>
>>
>> Thanks!
>> Cam
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://www.erlang.org/mailman/listinfo/erlang-questions
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090501/e1bc2c8d/attachment.html>


More information about the erlang-questions mailing list