[erlang-questions] suspending/resuming a process

Bengt Kleberg bengt.kleberg@REDACTED
Tue Dec 3 14:12:31 CET 2013


These are opinions, not facts.

When reading the sys manual page it mentions that the process "should
implement the standard behaviours" or "still understand system
messages".
Your process does not seem to do that.

bengt

On Tue, 2013-12-03 at 15:05 +0200, Martin Dimitrov wrote:
> Hello,
> 
> I am trying to figure out how to use sys:suspend/1,2 and sys:resume/1,2
> but without any luck.
> 
> I tried:
> 
> 1> P = spawn(fun() -> lists:foreach(fun(_) -> io:format("cool~n", []),
> timer:sleep(1000) end, lists:seq(1, 100)) end).
> 2> sys:suspend(P).
> 
> but the process clearly continued to run because was printing "cool"
> every second.
> 
> After 5 seconds (which is the default timeout for sys:suspend/1,2, I
> guess), I got the following error:
> 
> ** exception exit: {timeout,{sys,suspend,[<0.176.0>]}}
>      in function  sys:send_system_msg/2 (sys.erl, line 242)
> 
> Thank you very much,
> 
> Martin
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list