[erlang-questions] : driver_entry stop() and driver_async() interaction

Paul Fisher pfisher@REDACTED
Thu Dec 18 13:41:31 CET 2008


Any word on this?


Raimo Niskanen wrote:
> On Thu, Nov 06, 2008 at 12:22:45PM -0600, Paul Fisher wrote:
>> Can anyone comment on this question i sent a few weeks ago?
>>
>> When the port owner terminates and there are driver_async() requests 
>> scheduled and not yet executed, I am seeing them outstanding at the time 
>> of the stop() callback.
> 
> We will take a look at it and make it clear in some
> documentation and give you an answer. It will take a bit of
> code review to be certain...
> 
>>
>> Paul Fisher wrote:
>>> Question about work scheduled on async threads via driver_async() and
>>> still pending (i.e. they are still on the queue to be executed,) when
>>> the stop() callback is invoked.  Specifically, assuming smp w/async
>>> thread pool and the driver marked ERL_DRV_FLAG_USE_PORT_LOCKING.
>>>
>>> Is it the responsibility of the code in the stop() callback to call
>>> driver_async_cancel() on each outstanding async work item, or will this
>>> be done automatically by the emulator before the call to stop()?
>>>
>>> If this is the responsibility of the code in stop(), is it guaranteed
>>> that no async work item will be executing or scheduled during the call
>>> to the stop() callback?
>>>
>>> If no guarantee is made, is holding the PDL necessary and sufficient to
>>> guarantee this?
>>
>> --
>> paul
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://www.erlang.org/mailman/listinfo/erlang-questions
> 




More information about the erlang-questions mailing list