aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc/src/driver_entry.xml
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2012-11-16 09:27:28 +0100
committerRickard Green <[email protected]>2012-11-16 09:27:28 +0100
commit15f3cb7cb7074d507f70e778862e285e844b8546 (patch)
tree5664fe12e7f473d416ece923b8754a13f11c7fc6 /erts/doc/src/driver_entry.xml
parent952d8eb752c8ac5ff029b442404c5fe647c9af38 (diff)
parent8a273f85e26ad7ae533b0d9e5f429be34ee8a537 (diff)
downloadotp-15f3cb7cb7074d507f70e778862e285e844b8546.tar.gz
otp-15f3cb7cb7074d507f70e778862e285e844b8546.tar.bz2
otp-15f3cb7cb7074d507f70e778862e285e844b8546.zip
Merge branch 'rickard/native-doc/OTP-10557' into maint
* rickard/native-doc/OTP-10557: Add clearer warnings about misuse of NIF and driver functionality
Diffstat (limited to 'erts/doc/src/driver_entry.xml')
-rw-r--r--erts/doc/src/driver_entry.xml23
1 files changed, 23 insertions, 0 deletions
diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml
index a2efdf3ebc..929c485c36 100644
--- a/erts/doc/src/driver_entry.xml
+++ b/erts/doc/src/driver_entry.xml
@@ -34,6 +34,29 @@
<lib>driver_entry</lib>
<libsummary>The driver-entry structure used by erlang drivers.</libsummary>
<description>
+ <marker id="WARNING"/>
+ <warning><p><em>Use this functionality with extreme care!</em></p>
+ <p>A driver callback is executed as a direct extension of the
+ native code of the VM. Execution is not made in a safe environment.
+ The VM can <em>not</em> provide the same services as provided when
+ executing Erlang code, such as preemptive scheduling or memory
+ protection. If the driver callback function doesn't behave well,
+ the whole VM will misbehave.</p>
+ <list>
+ <item><p>A driver callback that crash will crash the whole VM.</p></item>
+ <item><p>An erroneously implemented driver callback might cause
+ a VM internal state inconsistency which may cause a crash of the VM,
+ or miscellaneous misbehaviors of the VM at any point after the call
+ to the driver callback.</p></item>
+ <item><p>A driver callback that do
+ <seealso marker="erl_driver#lengthy_work">lengthy work</seealso>
+ before returning will degrade responsiveness of the VM,
+ and may cause miscellaneous strange behaviors. Such strange behaviors
+ include, but are not limited to, extreme memory usage, and bad load
+ balancing between schedulers. Strange behaviors that might occur due
+ to lengthy work may also vary between OTP releases.</p></item>
+ </list>
+ </warning>
<p>
As of erts version 5.9 (OTP release R15B) the driver interface
has been changed with larger types for the callbacks