Acknowledge messages

Mickael Remond mickael.remond@REDACTED
Tue Dec 31 11:10:32 CET 2002


* Eduardo Figoli <eduardo@REDACTED> [2002-12-31 20:17:34 +0100]:

I assume you should have a very straight deadline to repost this message a 31
december ;-)
So, here is a first answer.

> Is it necessary to acknowledge every message I sent to a process ?

It really depend on your protocol. So the answer is no, this is not necessary
:-)

Basically this difference is a choice between a synchronous operation (where
you wait for the reply) and asynchronous operation when the process that send
the message is not blocked and can pursue its execution.

In some cases, your initiating process simply cannot wait for the answer, in
particular if the answer time can be particularly long. You should then avoid
blocking message passing.

If your question is about being sure that the destination process have received
a given message, the answer is no, there is no such garanty. This rely on your
own protocol. Message passing in Erlang is said to rely on a "send and pray"
mechanism. It is up to you to build the mechanism you need on top of it.

> If it's the case is there a better choice to do this than by hand (send
> message and receive ack) ?

If you are using OTP behaviour there is everything packed in it. You have
functions to do synchronous or asynchronous calls.

I hope this helps.

-- 
Mickaël Rémond



More information about the erlang-questions mailing list