here - Stefan-Marr.de
here - Stefan-Marr.de
here - Stefan-Marr.de
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
2.4. Common Approaches to Concurrent and Parallel Programming<br />
task-oriented, while HPC applications are mostly data-oriented, which leads<br />
to different tra<strong>de</strong>offs in the <strong>de</strong>sign and implementation of algorithms.<br />
Actors The actor mo<strong>de</strong>l is a formalism to <strong>de</strong>scribe computational systems.<br />
Hewitt et al. [1973] distilled it from the many i<strong>de</strong>as of that time in the field<br />
of artificial intelligence to provi<strong>de</strong> a “co<strong>here</strong>nt manageable formalism”. This formalism<br />
is based on a single kind of object, an actor. These actors are computational<br />
units that respond to messages by sending messages to other actors,<br />
create new actors, or <strong>de</strong>signate how to handle the next message they receive.<br />
Communication is done via addresses of other actors. An actor has to be introduced<br />
explicitly to another actor or it has to create the actor to know its<br />
address. Later, Hewitt [2012] clarified that the actor mo<strong>de</strong>l assumes that messages<br />
are processed concurrently, and more importantly, that actors do not<br />
require any notion of threads, mailboxes, message queues, or even operating<br />
system processes.<br />
The benefit of the actor mo<strong>de</strong>l is that it provi<strong>de</strong>s a concise formalism to<br />
<strong>de</strong>scribe systems. By using the simplest possible notion of the actor mo<strong>de</strong>l<br />
in the way Hewitt [2012] proposes, the actor mo<strong>de</strong>l achieves <strong>de</strong>sirable theoretical<br />
properties such as locality, safety of communication, and unboun<strong>de</strong>d<br />
non<strong>de</strong>terminism.<br />
However, the minimalism of the mo<strong>de</strong>l comes with a significant engineering<br />
tra<strong>de</strong>off. Similarly to the discussion of the right object granularity for<br />
co<strong>de</strong> reuse, which component-based software engineering tries to address,<br />
the granularity of actors becomes important when actors are used to build<br />
software systems. The i<strong>de</strong>a of event-loop concurrency tries to address these<br />
granularity issues.<br />
Event-Loop Concurrency E and AmbientTalk propose the i<strong>de</strong>a of actors integrated<br />
with object-oriented programming languages [Miller et al., 2005; Van<br />
Cutsem et al., 2007]. E uses the term vat to <strong>de</strong>note a container of objects, which<br />
in AmbientTalk corresponds to an actor, that holds an object graph. Insi<strong>de</strong> a<br />
vat, objects can refer to each other with near references. References between<br />
different vats are only possible via far references. While near references allow<br />
synchronous access to objects, far references only allow asynchronous interaction.<br />
The semantics of far references is that of asynchronous message sends.<br />
Every vat executes an infinite loop that processes incoming messages. Based<br />
on these i<strong>de</strong>as, Van Cutsem <strong>de</strong>scribes the three main properties of the eventloop<br />
concurrency mo<strong>de</strong>l as follows: Serial execution is guaranteed insi<strong>de</strong> a vat.<br />
31