CAF - The C++ Actor Framework for
Scalable and Resource-efficient Applications
Dominik Charousset
Hamburg University of Applied Sciences
dcharousset@acm.org
Raphael Hiesgen
Hamburg University of Applied Sciences
raphael.hiesgen@haw-hamburg.de
Thomas C. Schmidt
Hamburg University of Applied Sciences
t.schmidt@ieee.org
Abstract
The actor model of computation has gained significant popularity
over the last decade. Its high level of abstraction combined with its
flexibility and efficiency makes it appealing for large applications
in concurrent and distributed regimes.
In this paper, we report on our work of designing and building
CAF, the “C++ Actor Framework”. CAF targets at providing an ex-
tremely scalable native environment for building high-performance
concurrent applications and distributed systems. Based on our pre-
vious library libcppa, CAF significantly extends its scopes of ap-
plication and operation, as well as the range of scalability. The par-
ticular contributions of this paper are threefold. First we present
the design and implementation of a type-safe messaging interface
for actors that rules out a category of runtime errors and facili-
tates robust software design. Second we introduce a runtime in-
spection shell as a first building block for convenient debugging of
distributed actors. Finally we enhance the scheduling facilities and
improve scaling up to high numbers of concurrent processors. Ex-
tensive performance evaluations indicate ideal runtime behaviour
for up to 64 cores at very low memory footprint. In these tests,
CAF clearly outperforms competing actor environments.
Categories and Subject Descriptors D.1.3 [Programming Tech-
niques]: Concurrent programming; C.2.4 [Distributed Systems]:
Distributed applications; D.3.4 [Processors]: Run-time environ-
ments
Keywords Actor Model, C++, Message-oriented Middleware,
Distributed Debugging
1. Introduction
In recent times, an increasing number of applications requires very
high performance for serving concurrent tasks. Hosted in elastic,
virtualized environments, these programs often need to scale up in-
stantaneously to satisfy high demands of many simultaneous users.
Such use cases urge program developers to implement tasks con-
currently wherever algorithmically feasible, so that running code
can fully adapt to the varying resources of a cloud-type setting.
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full citation
on the first page. Copyrights for components of this work owned by others than ACM
must be honored. Abstracting with credit is permitted. To copy otherwise, or republish,
to post on servers or to redistribute to lists, requires prior specific permission and/or a
fee. Request permissions from permissions@acm.org.
AGERE! ’14
, USA.
Copyright
c
2014 ACM .... . . $15.00.
http://dx.doi.org/10.1145/...
However, dealing with concurrency is challenging and handwritten
synchronisations easily lack performance, robustness, or both.
At the low end, the emerging Internet of Things (IoT) pushes
demand for applications that are widely distributed on a fine granu-
lar scale. Such loosely coupled, highly heterogeneous IoT environ-
ments require lightweight and robust application code which can
quickly adapt to ever changing deployment conditions. Still, the
majority of current applications in the IoT is built from low level
primitives and lacks flexibility, portability, and reliability. The envi-
sioned industrial-scale applications of the near future urge the need
for an appropriate software paradigm that can be efficiently applied
to the various deployment areas of the IoT.
Forty years ago, a seminal concept to the problems of concur-
rency and distribution has been formulated in the actor model by
Hewitt, Bishop, and Steiger [15]. With the introduction of a sin-
gle primitive—called actor—for concurrent and distributed entities,
the model separates the design of a software from its deployment
at runtime. The high level of abstraction offered by this approach
combined with its flexibility and efficiency makes it highly attrac-
tive for today’s elastic multicore systems, as well as for tasks dis-
tributed on Internet scale. As such, the actor concept is capable
of providing answers to urgent problems throughout the software
industry and has been recognized as an important tool to make ef-
ficient use of the infrastructure.
On its long path from an early concept to a wide adoption in
the real world, many contributions were needed in both, concep-
tual modeling and practical realization. In his seminal work, Agha
[1] introduced mailboxing for the message processing of actors,
and laid out the fundament for an open, external communication
[3]. Actor-based languages like Erlang [4] and frameworks such as
ActorFoundry—which is based on Kilim [27]—have been released
but remained in specific niches, or vendor-specific environments
(e.g., Casablanca [24]). Scala includes the actor-based framework
Akka [30] as part of its standard distribution, because the actor
model has proven attractive to application developers. The appli-
cation fields of the actor model also include cluster computing as
demonstrated by the actor-inspired framework Charm++ [17]. In
our previous work on libcppa [10], we introduced a full-fledged
C++ actor library to the native domain.
In this work, we report on the enhanced “C++ Actor Frame-
work” (CAF)
1
. CAF has evolved from our previous library libcppa
with significant improvements and additional capabilities. CAF
subsumes components for highly scalable core actor programming,
GPGPU Computing, and adaptations to a loose coupling for the
IoT [16], It has been adopted in several prominent application en-
vironments, among them scalable network forensics [ 31 ]. In the
present paper, we focus on three contributions.
1
http://www.actor-framework.org