[erlang-questions] Ideas for a new Erlang

Darren New dnew@REDACTED
Thu Jun 26 17:36:23 CEST 2008


Richard A. O'Keefe wrote:
> I hope that we can rely on Erlang garbage collection to
> collect any process suspended in a receive construct and not registered
> and not referenced by any other process. 

But we really can't, can we? That would imply that a GC happening on one 
node in California could send a message to Philadelphia to let that node 
know there's one less reference to the process ID.

It would also imply that term_to_binary serializing a process ID and 
then dropping the variable holding the actual PID would allow the 
process to exit. So process A wrapping a PID of process X in a binary, 
dropping it into processes B's mailbox, then exiting, might cause 
process X to exit before process B read the binary out of its mailbox 
and turned it back into a term.

I don't think the semantics of Erlang are such that anyone expects 
processes to exit just because nobody can send them a message. What 
would be the exit reason? Could you put catch around the receive and 
keep running?

(That *is* how Hermes worked: to kill a runaway process, you just 
snipped off its output channels by having the processes listening exit, 
and the process could no longer affect its environment. But Hermes had a 
completely different strategy from Erlang for handling failures.)

-- 
Darren New / San Diego, CA, USA (PST)
  Helpful housekeeping hints:
   Check your feather pillows for holes
    before putting them in the washing machine.



More information about the erlang-questions mailing list