From 78f639da759cd3f8b5f28bc86ec404f3c3db60f4 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Fri, 13 Apr 2018 14:33:38 +0200 Subject: New process suspend implementation based on async signaling --- erts/doc/src/erlang.xml | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 3154fdaf8c..cff56b9cb8 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -7005,10 +7005,47 @@ ok from other events in the system. It is only guaranteed that Suspendee eventually suspends (unless it - is resumed). If option asynchronous has not + is resumed). If no asynchronous options has been passed, the caller of erlang:suspend_process/2 is blocked until Suspendee has suspended.

+ {asynchronous, ReplyTag} + +

A suspend request is sent to the process identified by + Suspendee. When the suspend request + has been processed, a reply message is sent to the caller + of this function. The reply is on the form {ReplyTag, + State} where State is either:

+ + exited + +

+ Suspendee has exited. +

+
+ suspended + +

+ Suspendee is now suspended. +

+
+ not_suspended + +

+ Suspendee is not suspended. + This can only happen when the process that + issued this request, have called + resume_process(Suspendee) + before getting the reply. +

+
+
+

+ Appart from the reply message, the {asynchronous, + ReplyTag} option behaves exactly the same as the + asynchronous option without reply tag. +

+
unless_suspending

The process identified by Suspendee is @@ -7032,6 +7069,13 @@ ok

This BIF is intended for debugging only.

+ +

You can easily create deadlocks if processes suspends + each other (directly or in circles). In ERTS versions prior + to ERTS version 10.0, the runtime system prevented such + deadlocks, but this prevention has now been removed due + to performance reasons.

+

Failures:

badarg -- cgit v1.2.3