
Revisiting Actor Programming in C++ (2015) - pthyme
https://arxiv.org/abs/1505.07368
======
brobdingnagians
I've looked into CAF, but haven't used it yet, is anyone using it successfully
in a production environment? And what is the comparison with Erlang? My
impression is that Erlang has better error handling capabilities, but CAF
should be a bit faster, but was curious about a comparison from someone more
knowledgeable.

~~~
eao197
JIF: there is more than just CAF in C++ land [1]

There are at least QP/C++ [2] and SObjectizer [3].

All three frameworks are used in production, especially QP/C++.

Error handling in C++ actor frameworks is a different topic than such handling
in Erlang or other safe language. Because if you do something like division by
0 or deference of null pointer in your C++ actor you will have a different
result: in the best case the whole your application will crush, not just one
actor.

[1] [https://www.slideshare.net/YauheniAkhotnikau/actor-model-
and...](https://www.slideshare.net/YauheniAkhotnikau/actor-model-and-c-what-
why-and-how) [2] [https://www.state-machine.com/qpcpp/](https://www.state-
machine.com/qpcpp/) [3]
[https://stiffstream.com/en/products/sobjectizer.html](https://stiffstream.com/en/products/sobjectizer.html)

~~~
brobdingnagians
Thanks! Those are good resources

------
srean
A question for those who are more knowledgeable than me -- Is Actor model the
same as the CSP model ? They feel the same but I am not sure.

~~~
keithnz
[https://en.wikipedia.org/wiki/Communicating_sequential_proce...](https://en.wikipedia.org/wiki/Communicating_sequential_processes#Comparison_with_the_actor_model)

~~~
srean
Ah! Thank you very much.

~~~
eao197
This point:

"CSP message-passing fundamentally involves a rendezvous between the processes
involved in sending and receiving the message, i.e. the sender cannot transmit
a message until the receiver is ready to accept it."

it not that strict in a practice. In dependency of implementation of CSP there
can be CSP-channels with limited and unlimited capacity. If channels with
limited capacity are used then some kind of rendezvous is necessary only on
attempt to write a new message to a full channel. In that case process-writer
will be blocked until process-reader read some messages from the channel.

If size-unlimited channels are used then interaction of CSP-processes will be
asynchronous (just like in Actor Model).

There is another important difference (but it also depends on implementation
details): CSP-processes are always proactive. They can do something even if
there is no messages to read and process.

Otherwise actors are reactive (usually). They react only to incoming messages
and do nothing if there is no new message in they inboxes.

This especially true for cases when actors are implemented as objects with
callbacks (for example it is true for Akka, CAF, SObjectizer, QP/C++, Orleans
and so on).

But there can be implementations of Actor Model where an actor has to call
some kind `receive` primitive to get an incoming message. For example it is
Erlang programming language and Just::Thread Pro Actor Edition library for
C++.

