1/14
Communication models, erlang messaging, concurracy
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is significant for synchronous communication?
the send operation blocks and waits for the receive operation
What is significant for asynchronous communication?
a sender can continue without waiting for the receive operation
What is true for asynchronous communication?
sender does not block waiting for receiver
Can a synchronous communication interface be used in an asynchronous way?
yes, by performing the send operation in a separate thread
What is the difference between the two nodes that are communicating using a stream socket API?
nothing, they have equal rights and responsibilities
The Erlang call gen tcp:recv(Socket, 0) will return:
the first part (possibly the whole) message sent to Socket
A server using a stream socket API can communicate with several clients and separate the streams by:
creating a new stream socket for each connecting client
How do Erlang processes communicate?
asynchronous message passing
Does Erlang provide a form of location transparency?
Yes - a process can use a process identifier without having to know the address of the node where the process lives.
How is the destination defined in an Erlang send operation?
as a process identifier or a local or remote registered name
What will prevent an Erlang process from sending a message to a process on another Erlang node?
the two nodes do not have the same secret cookie
Message sending in Erlang provides the following semantics:
best effort FIFO delivery of message
Can we have a circular construction in Erlang?
yes, processes can refer to each other in a circular way
What happens with Erlang processes that are suspended on a receive statement but no longer referenced by any process?
they will remain if registered, otherwise removed by the garbage collector
Assume we have three Erlang processes: A, B and C.
Also assume that A sends a message, m1, to B and then sends a message, m2, to C. B is suspended, waiting for a message from A that it will send to C.
What is guaranteed by the Erlang semantics.
no guarantees on receiving nor ordering of messages