[erlang-questions] Programming question

Ladislav Lenart <>
Wed Jan 24 16:23:50 CET 2007


Sean Hinde wrote:
> 
> On 24 Jan 2007, at 14:28, Ladislav Lenart wrote:
> 
>> Sean Hinde wrote:
>>> Hi,
>>>
>>> A quick question for Erlang gurus out there.
>>>
>>> I have two processes A and B. B spends most of its life in a series
>>> of gen_server calls towards A:
>>>
>>> loopB(PidA, S) ->
>>>       Res = gen_server:call(PidA, {op, stuff}),
>>>       S1 = process(Res, S),
>>>       loopB(PidA, S1).
>>>
>>> The question is how do I set things up so that if A dies B is killed?
>>
>> I am not a guru, but if "to die" means to terminate abnormally,
>> you can link the two processes. BUT since links are bi-directional,
>> if B dies, A will be killed as well.
> 
> This won't do it. If A dies while processing the call from B, even when 
> linked, then B does not die.
Sorry for my slowness, but why not?

Ladislav Lenart




More information about the erlang-questions mailing list