aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc/src/erl_nif.xml
AgeCommit message (Collapse)Author
2019-05-22erts: Add some erl_nif doc clarificationsSverker Eriksson
2019-05-10Prepare releaseErlang/OTP
2019-04-24Revert "Prepare release"Rickard Green
This reverts commit 425889ba69b69a9b6fb14bfbef121d51b78e853a.
2019-04-23Prepare releaseErlang/OTP
2019-04-04Fix broken linksBjörn Gustavsson
A multitude of broken links were found when a bug was fixed in the link checker.
2019-03-26Revert "Prepare release"Henrik Nord
This reverts commit 0118046f9bda8dcf3594184fa439b79267db8017.
2019-03-25Prepare releaseErlang/OTP
2019-03-07erts: Add enif_term_typeJohn Högberg
This helps avoid long sequences of enif_is_xxx in code that serializes terms (such as JSON encoders) by letting the user switch on the type.
2019-02-27Revert "Prepare release"Rickard Green
This reverts commit df130102cdeca8d35fec95a0c926fd1cfec54eab.
2019-02-26Prepare releaseErlang/OTP
2019-02-21fixup! erts: Add enif_compare_pidsSverker Eriksson
fix broken html link
2019-02-20erts: Add enif_compare_pidsSverker Eriksson
as a macro wrappper around enif_compare
2019-02-20erts: Add enif_set_pid_undefined & enif_is_pid_undefinedSverker Eriksson
2019-02-19erts: Clarify erl_nif docsSverker Eriksson
for enif_send and enif_select_read|write.
2019-02-01erts: Add enif_make_monitor_termSverker Eriksson
2019-01-07erts: Add enif_select_read|write with 'msg_env' argumentSverker Eriksson
2018-12-13Merge branch 'maint'Sverker Eriksson
2018-12-12Add empty 'since' attribute for old modules and functionsSverker Eriksson
2018-12-11Add "since" attributes in xml for new functions and modulesSverker Eriksson
introduced after OTP_R13B03.
2018-11-29Merge branch 'maint'Sverker Eriksson
2018-11-29Replace mathematical jargon in erl_nif docs PR-2037Bartosz Błaszków
2018-11-22Merge branch 'maint'Sverker Eriksson
2018-11-21erts: Clarify erl_nif docs about callback environmentsSverker Eriksson
2018-10-01Merge branch 'maint'Lukas Larsson
2018-10-01Fix spelling of intended in erl_nif docsLukas Larsson
2018-07-20erts: Add ERL_NIF_SELECT_CANCEL flag for enif_selectSverker Eriksson
to deselect read and/or writes without stop callback.
2018-07-16erts: Clarify erl_nif docs of enif_*printf and %TSverker Eriksson
2018-07-09erts: Fix spec and docs for process_info 'monitored_by'Sverker Eriksson
to include ports and NIF resources. Added new opaque type 'nif_resource'.
2018-06-18Update copyright yearHenrik Nord
2018-04-06erts: Fix doc typo for enif_free_iovecSverker Eriksson
2018-03-23Add enif_make_map_from_arraysJohn Högberg
2018-03-22Merge branch 'sverker/enif-name-funcs/OTP-14994'Sverker Eriksson
2018-03-22erts: Remove const from ErlNifResourceDown docSverker Eriksson
to conform with erl_nif.h
2018-03-22erts: Add statement about errno to enif_*printf docsSverker Eriksson
2018-03-22erts: Add enif_vfprintf and enif_vsnprintfSverker Eriksson
2018-03-22erts: Add enif_*_name functionsSverker Eriksson
2018-03-16Merge pull request #1746 from legoscia/erl_nif.xml-spellingLukas Larsson
Fix typos in erl_nif.xml
2018-03-13Fix typos in erl_nif.xmlMagnus Henoch
2018-03-07erts: Add enif_fprintf docsSverker Eriksson
2018-02-26Merge branch 'maint'Sverker Eriksson
2018-02-26Suggest using enif_make_new_binary when possibleJohn Högberg
While enif_make_binary will create heap-binaries from ErlNifBinaries when possible now, enif_alloc_binary still allocates a Binary* off-heap which is avoided entirely with enif_make_new_binary.
2018-02-23erts: Clarify enif_self docsSverker Eriksson
2017-11-30Add enif_ioq_peek_headJohn Högberg
This introduces a way to retrieve erlang terms from NIF IO queues without having to resort to copying. OTP-14797
2017-11-23Document alignment guarantees of enif_alloc and enif_reallocAnthony Ramine
2017-11-21Document enif_reallocAnthony Ramine
2017-09-07Merge branch 'sverker/nif-resource-doc' into maintSverker Eriksson
* sverker/nif-resource-doc: erts: Update docs for enif_make_resource
2017-09-05erts: Update docs for enif_make_resourceSverker Eriksson
to include new defined properties in OTP-20 regarding comparison and serialization.
2017-09-05erts: Add nif ioqLukas Larsson
2017-05-22Add enif_whereis_...() functionsTed Burghart
#### Why do we need this new feature? There are cases when a NIF needs to send a message, using `enif_send()`, to a long-lived process with a registered name. A common use-case is logging, where asynchronous fire-and-forget messages are the norm. There can also be cases where a yielding or dirty NIF or background thread may request a callback from a service with additional information it needs to complete its operation, yielding or waiting (with suitable timeouts, etc) until its state has been updated through the NIF module's API. NIFs can only send messages to pids, and the lack of name resolution leaves a complicated dance between separate monitoring processes and the NIF as the only way to keep a NIF informed of the whereabouts of such long-lived processes. Providing a reliable, built-in facility for NIFs to resolve process (or port) names simplifies these use cases considerably. #### Risks or uncertain artifacts? Testing has not exposed any significant risk. The implementation behaves as expected on regular and dirty scheduler threads as well as non-scheduler threads. By constraining the `enif_whereis_...()` functions to their minimal scopes and using patterns consistent with related functions, the implementation, testing, and maintenance burden is low. The API and behavior of existing functions is unchanged. #### How did you solve it? While extending `enif_send()` to operate on a pid or an atom (as `erlang:send/2` does) was attractive, it would have entailed changing the type of its `to_pid` parameter and thereby breaking backward compatibility. The same consideration applies to `enif_port_command()`. That leaves a choice between 1, 2, or 3 new functions: 1. `enif_whereis()` 2. `enif_whereis_pid()` and `enif_whereis_port()` 3. All of the above. While option (1), directly mimicking the behavior of `erlang:whereis/1`, is appealing, it poses potential problems if `pid()` or `port()` are subsequently implemented as non-integral types that must be bound to an owning `ErlNifEnv` instance. Therefore, option (2) has been chosen to use `ErlNifPid`/`ErlNifPort` structures in the API to maintain proper term ownership semantics.
2017-05-10erts: Improve erl_nif docsSverker Eriksson