From f8d2dfc06b599b8e3335a2afef89c763b01d6f55 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 20 May 2019 17:35:06 +0200 Subject: erts: Clarify erlang:system_monitor/2 semantics --- erts/doc/src/erlang.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index a879cce840..998c9b6272 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -9412,6 +9412,18 @@ Metadata = #{ pid => pid(),

Returns the previous system monitor settings just like erlang:system_monitor/0.

+

The arguments to system_monitor/2 specifies how all + system monitoring on the node should be done, not how it should be + changed. This means only one process at a time + (MonitorPid) can be the receiver of system monitor + messages. Also, the way to clear a specific monitor option + is to not include it in the list Options. All + system monitoring will, however, be cleared if the process identified by + MonitorPid terminates.

+

There are no special option values (like zero) to clear an option. + Some of the options have a unspecified minimum value. Lower values + will be adjusted to the minimum value. For example, it is currently not + possible to monitor all garbage collections with {long_gc, 0}.

If a monitoring process gets so large that it itself starts to cause system monitor messages when garbage -- cgit v1.2.3 From 7d54af059fffd27286f6a236470a9096c09921a9 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 22 May 2019 17:48:00 +0200 Subject: erts: Add some erl_nif doc clarifications --- erts/doc/src/erl_nif.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index f88d255296..d74ae23a93 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1495,6 +1495,9 @@ enif_free_iovec(iovec);]]> term.

Returns true on success, or false if term is not a handle to a resource object of type type.

+

enif_get_resource does not add a reference to the resource + object. However, the pointer received in *objp is guaranteed to + be valid at least as long as the resource handle term is valid.

@@ -2947,6 +2950,10 @@ enif_map_iterator_destroy(env, &iter); References made by enif_make_resource can only be removed by the garbage collector.

+

There are no guarantees exactly when the destructor of an + unreferenced resource is called. It could be called directly by + enif_release_resource but it could also be scheduled to be + called at a later time possibly by another thread.

-- cgit v1.2.3