[erlang-questions] Port Driver. erl_drv_thread_join and ErlDrvTid reuse.

Zhemzhitsky Sergey sergey_zhemzhitsky@REDACTED
Thu Oct 11 16:17:25 CEST 2012


Thanks a lot. Now it's clear enough.

Best Regards,
Sergey

-----Original Message-----
From: Rickard Green [mailto:rickard@REDACTED] 
Sent: Thursday, October 11, 2012 6:13 PM
To: Zhemzhitsky Sergey
Cc: Erlang Questions
Subject: Re: [erlang-questions] Port Driver. erl_drv_thread_join and ErlDrvTid reuse.



On 10/11/2012 03:11 PM, Zhemzhitsky Sergey wrote:
> Hi Rickard,
>
>>> Are you calling driver_failure_atom() from your thread? That would explain this issue.
>
> Exactly. Could you explain a little bit more why it can cause this issue (I suppose it's due to it is not thread safe)?
>

Yes, it is because driver_failure_atom() is not thread safe. Apart from misc thread unsafe modifications of the port internal state,
driver_failure_atom() can call the stop() callback which means that your thread will end up trying to join with itself.

Regards,
Rickard
--
Rickard Green, Erlang/OTP, Ericsson AB.

_______________________________________________________
CONFIDENTIALITY NOTICE: This email and any files attached to it may be conf idential. If you are not the intended recipient you are notified that using, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error please notify the sender and delete this email. 



More information about the erlang-questions mailing list