ensure_started

Luke Gorrie luke@REDACTED
Mon Mar 24 18:19:46 CET 2003


Ulf Wiger <etxuwig@REDACTED> writes:

> >I guess the lesson to take from this is that it's good
> >coding style to always use a finite timeout when waiting
> >for a reply from something you're not linked to, because
> >that reply simply may never show up no matter how carefully
> >you code the server... ?
> 
> Oh yes.  (:
> 
> Actually, monitors take care of the cases where the server
> dies before responding, but there are other cases where a
> timeout is really needed. Deadlocks due to rare combinations
> of events is one such occasion. Finite timeouts give a
> rather clear indication that something is not quite right.

Perhaps one should really use gen:call for synchronous calls in
home-made processes?

I wonder if the occasionally-proposed "!!" synchronous message send
could be neatly implemented as syntactic sugar for gen:call. Or
perhaps !? for (gen:)call and !! for (gen:)reply.

Too bad you can't tweak the language grammar with parse transforms
alone to try this stuff :-)

-Luke




More information about the erlang-questions mailing list