<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1522" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><SPAN class=990385319-19112005><FONT face=Arial color=#0000ff size=2>I
agree. /Uffe</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Robert Virding
[mailto:robert.virding@telia.com] <BR><B>Sent:</B> den 19 november 2005
18:21<BR><B>To:</B> Ulf Wiger (AL/EAB)<BR><B>Cc:</B> Dominic Williams;
erlang-questions@erlang.org<BR><B>Subject:</B> Re: Uncertain
death<BR></FONT><BR></DIV>
<DIV></DIV>Doing exit(Pid, kill) sends an exit signal, of value kill, to the
process so it should be scheduled in the same way as "normal" exit signals.
Generally I think you should be careful if you start special casing various
things as you can get unexpected behavious.<BR><BR>Robert<BR><BR>Ulf Wiger
(AL/EAB) wrote:
<BLOCKQUOTE
cite=midD4ADC896EC3F5948A9D3899986CEB9DE0271EAC0@esealmw115.eemea.ericsson.se
type="cite"><PRE wrap="">When you send an exit signal to a process,
it is scheduled in order to receive it.
This goes for 'kill' messages as well, even
though you'd think that they could be
killed right away by the runtime system.
/Uffe
</PRE>
<BLOCKQUOTE type="cite"><PRE wrap="">-----Original Message-----
From: <A class=moz-txt-link-abbreviated href="mailto:owner-erlang-questions@erlang.org">owner-erlang-questions@erlang.org</A>
[<A class=moz-txt-link-freetext href="mailto:owner-erlang-questions@erlang.org">mailto:owner-erlang-questions@erlang.org</A>] On Behalf Of
Dominic Williams
Sent: den 17 november 2005 23:32
To: '<A class=moz-txt-link-abbreviated href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</A>'
Subject: Uncertain death
Hello,
The following program seems to me to indicate that when a
processes gets killed, there is, for a brief moment,
contradictory information about its state. Specifically, the
information returned by processes() seems to lag behind that
given by is_process_alive().
%%% death.erl
-module (death).
-export ([run/0, server/0]).
run() ->
Pid = spawn (?MODULE, server, []),
exit (Pid, kill),
report (Pid),
timer:sleep(1000),
report (Pid).
report (Pid) ->
io:fwrite("~p alive: ~p; member of processes(): ~p~n",
[Pid, is_process_alive (Pid),
lists:member(Pid, processes())]).
server () ->
receive
hello ->
server();
stop ->
bye
end.
%%% end death.erl
1> c("/Users/dodo/tmp/death", [{outdir, "/Users/dodo/tmp/"}]).
{ok,death}
2> death:run().
<0.35.0> alive: false; member of processes(): true <0.35.0>
alive: false; member of processes(): false ok
Same result under MacOS/R9C and WinXP/R10B
Regards,
Dominic Williams
<A class=moz-txt-link-freetext href="http://www.dominicwilliams.net">http://www.dominicwilliams.net</A>
----
</PRE></BLOCKQUOTE><PRE wrap=""><!---->
</PRE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>