[erlang-questions] Re: erl startup

Wes James comptekki@REDACTED
Wed May 19 05:22:37 CEST 2010


On Tue, May 18, 2010 at 9:11 PM, Bernard Duggan <bernie@REDACTED> wrote:
> On 19/05/10 12:59, Wes James wrote:
>>
>> Any explanation here?
>>
>
> Yep.
>
> My guess is that -run either spawns your function in a new process or (more
> likely) runs it in a process which subsequently exits.  That means that:
>
> a) The timer will stop (since the process that launched it shut down).
> b) The return value ("id_table: " ++ Id_Table) will not be printed (since
> there's no command to print it).
> c) The ets table will no longer exist (since, again, the process that
> spawned it has finished and you did not specify an heir), hence the badarg
> when you try to reference it.
>
> By contrast, when you run my_mod:start() from the shell, the shell process
> that launched it continues to run (so the timer and the ets table persist),
> and the return value is printed (as happens with any other function you call
> from the shell).
>
> B
>

Bernard,

Thx.  I guess I need to look at spawning this??

-wes


More information about the erlang-questions mailing list