[erlang-questions] How does code:purge/1 know to kill processes?

Mikael Pettersson mikpelinux@REDACTED
Thu Jun 9 09:44:05 CEST 2016

Roger Lipscombe writes:
 > The documentation for code:purge/1
 > (http://erlang.org/doc/man/code.html#purge-1) says "If some processes
 > still linger in the old code, these processes are killed before the
 > code is removed."
 > How is "lingering" defined?
 > Does the VM kill the process when it attempts to invoke the old module?
 > Does the VM walk the stack for all processes and kill those that have
 > the old code somewhere in their call stack?

My understanding is that it's the latter, i.e., if you're currently in
a to-be-deleted module, or you have a return address referring to one,
then you get killed.

I'm not sure how FUNs are handled.

 > Something else?
 > _______________________________________________
 > erlang-questions mailing list
 > erlang-questions@REDACTED
 > http://erlang.org/mailman/listinfo/erlang-questions


More information about the erlang-questions mailing list