From 23c6f9e07a3cae7c05e55abd01ff798384241538 Mon Sep 17 00:00:00 2001
From: Rickard Green
Functions not explicitly documented as thread-safe are
- not thread-safe. Also note that some functions
+ Functions not explicitly documented as thread safe are
+ not thread safe. Also note that some functions
are only thread safe when used in a runtime
system with SMP support.
A function not explicitly documented as thread safe may at + some point in time have a thread safe implementation in the + runtime system. Such an implementation may however change to + a thread unsafe implementation at any time without + any notice at all. +
+Only use functions explicitly documented as thread safe + from arbitrary threads.
+This function returns the port owner process.
+Note that this function is not thread-safe, not + even when the emulator with SMP support is used.
Note that this function is not thread-safe, not + even when the emulator with SMP support is used.
This functions sends data in the special driver term - format. This is a fast way to deliver term data from a - driver. It also needs no binary conversion, so the port - owner process receives data as normal Erlang terms.
+ format to the port owner process. This is a fast way to + deliver term data from a driver. It also needs no binary + conversion, so the port owner process receives data as + normal Erlang terms. The +Note that the
The
Tuple and lists (with the exception of strings, see below), are built in reverse polish notation, so that to build a tuple, the elements are given first, and then the tuple @@ -1664,17 +1684,17 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len ErlDrvPort port = ... ErlDrvTermData spec[] = { ERL_DRV_ATOM, driver_mk_atom("tcp"), - ERL_DRV_PORT, driver_mk_port(port), + ERL_DRV_PORT, driver_mk_port(drvport), ERL_DRV_INT, 100, ERL_DRV_BINARY, bin, 50, 0, ERL_DRV_LIST, 2, ERL_DRV_TUPLE, 3, }; - driver_output_term(port, spec, sizeof(spec) / sizeof(spec[0])); + erl_drv_output_term(driver_mk_port(drvport), spec, sizeof(spec) / sizeof(spec[0])); ]]>
Where
The term
The
If you want to pass a binary and don't already have the content
of the binary in an
This function is only thread-safe when the emulator with SMP + support is used.
+The parameters
Note that this function is not thread-safe, not even when the emulator with SMP support is used.
Note that this function is not thread-safe, not + even when the emulator with SMP support is used.
This function converts a port handle to the erlang term
- format, usable in the
Note that this function is not thread-safe, not + even when the emulator with SMP support is used.
This function is the only way for a driver to send data to
other processes than the port owner process. The
Note that the
The parameters
This function is only thread-safe when the emulator with SMP + support is used.
+Also note that parameters of
The parameters
This function is only thread-safe when the emulator with SMP support is used.