[erlang-questions] [LONG] How to make synchronous message passing

Richard Carlsson richardc@REDACTED
Tue Oct 2 14:54:49 CEST 2007


ZeD wrote:
> for istance, let's say a process P want to make Q talk to P himself (for
> some reason). So, we shoud write
> 
> synchro(P, {do, Q, {ask, P}}).

It seems that you are not talking about normal synchronous communication,
but rather a form of nested request/reply. In synchronous message passing,
if P is waiting for a reply from Q then he is by definition blocked and
cannot answer the query from Q. Your implementation in synchro2 is correct,
but synchronous communication is not what you need for this problem. You
have to rethink what f does.

     /Richard




More information about the erlang-questions mailing list