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

Paul Fisher pfisher@REDACTED
Thu Oct 16 17:34:33 CEST 2008

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?


More information about the erlang-questions mailing list