[erlang-bugs] erl_driver documentation confusing

Paul Mineiro <>
Thu Jul 17 08:20:21 CEST 2008

the documentation for erl_driver says that to ensure that the same thread
is used for all calls to your driver you should do:

r = driver_async(myPort, (unsigned int*)&myPort, myData, myFunc);

well this caused me lots of troubles because inside the implementation to
driver_async in erts/emulator/beam/erl_async.c there is a line

*key = qix;

where key is the 2nd argument to driver_async.  this caused some
segmentation faults in my code until i realized this was happening (since
I continued to use myPort as a valid port).

-- p

p.z. is there a reason *key is assigned at all?

More information about the erlang-bugs mailing list