[erlang-questions] Classification of concurrency patterns
Henning Diedrich
hd2010@REDACTED
Sat May 15 16:29:52 CEST 2010
Joe's patterns had one, #5/Grid, with any communication between jobs.
The general train of thought starts out purely functional there I guess
with communication between jobs on the other end of the scale.
Maybe noting the difference between functional and non-functional "jobs"
as underlying building blocks of a pattern can clarify thinking.
You could have functional jobs, broadcasting jobs, receiving jobs,
implicitly and overtly blocking jobs. The latter may be a good early
indicator of anti-patterns were they appear in Joe's computing patterns,
while being potentially the norm in Guy's scenarios. They'd wait for
input to react to.
I can think of patterns where all processes are connected to
out-of-system resources and receiving signals from there, to then act.
Others, e.g. simulations, will receive no input on the part of the jobs
but still be non-functional in that they communicate among each other as
prescribed in the Grid or in the list below.
From Guy's list, all of Joe's, except the Grid, seem to be Stars. The
Grid itself seems to belong on Guy's list because of inter-job
communication but then again not because it is not meant to be
outside-world-reactional as far as I understand it.
Jobs
- functional
- broadcasting
- receiving (and possibly broadcasting)
- blocking
- - - - - - - -
- pure computation (all input state is available before start)
- receiving from other jobs
- receiving (even indirectly) from out of system
Henning
Guy Wiener wrote:
> Hello Joe, and everyone on the Erlang list,
> A colleague of mine commented that this list contains only transactional
> patterns (i.e, take data, process it and output it), but no reactive
> patterns (i.e, a system that responds to events over time without a single
> output or a predefined point of termination).
>
> One can observe several patterns for parallel reactive architectures, namely
> by the way the process collaborate:
>
> 1) Clique - Every process communicate with almost any other process. Each
> message includes the sender, to distinguish from other messages.
> 2) Broadcast - Processes do not collaborate with other specific processes,
> but broadcast messages without expecting a specific reply.
> 3) Subscribe/Notify - Processes broadcast messages to other pre-subscribed
> processes.
> 4) Star - "Peripheral" processes collaborate through a small group
> (potentially just one) of "central" processes, who decide for the rest what
> to do.
>
> One can also observe between two kinds of parallel reactive behavioral
> protocols:
>
> 1) Independent - Each process decides for itself what is the next step,
> regardless of other processes.
> 2) Consensus - All processes try to reach some agreement on the next step
> (often using a broadcast or star pattern).
>
> Would you consider these to be parallel patterns?
>
> Best,
> Guy Wiener.
>
>
More information about the erlang-questions
mailing list