Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

design patterns for telecom software hard multithreading problems

In Martin Fowler's book Patterns of Enterprise Application Architecture he writes on page 2: "In some ways enterprise applications are much easier than telecoms software -- we don't have very hard multithreading problems ...".

Is anybody aware of a summary of those "very hard multithreading problems" and solutions, in the form of design patterns, like the famous GoF Design Patterns book?

There is the POSA book. But those books might be too general and fundamental. More domain focused examples would be what this question is after.

like image 669
minghua Avatar asked Oct 14 '15 06:10

minghua


2 Answers

Check out Joe Armstrong's thesis from 2003:

Making reliable distributed systems in the presence of software errors.

Armstrong designed the software for a high-speed network switching device during his time at Ericsson. It was implemented in Erlang, which was specifically designed to provide highly reliable and highly concurrent applications.

In his thesis, he presents the underlying design decisions for the Erlang language itself and the OTP (Open Telecom Platform) library. He also makes some suggestions about how to design application modules for such applications -- this part comes closest to your 'design pattern', although not in the detail you're accustomed to after reading GoF's Design Patterns.

It's not a recipe book, but he nevertheless draws a few interesting conclusions about how applications should be designed.

like image 52
blubb Avatar answered Nov 07 '22 11:11

blubb


Actors

The actor model an architectural pattern where a system is made up of a set of loosely-coupled actors that interact through message passing.

An actor is a computational entity that, in response to a message it receives, can concurrently:

  • send a finite number of messages to other actors;
  • create a finite number of new actors;
  • designate the behavior to be used for the next message it receives.

One of the properties of such a system is that failure propagation is reduced, and as a consequence individual actors become more robust.

The programming language Erlang was specifically designed for telephony switches and supports the actor model.

State Machines

A pattern that is common in real-time & embedded software engineering are state machines. State machines can be implemented on top of actors, but also provide a mechanism to represent complex states and associated behavior.

Finite state machines (FSM) are a possibility, but they quickly start to get large and difficult to maintain because of State Explosion. A more expressive formalism that solves this problem are Hierarchical State Machines (HSM) as originally developed by David Harel.

A more recent implementation of the same semantics that fits object-oriented design is the UML State Machine, see Section 15 of the UML specification. This defines a model for state machines complete with their execution semantics.

like image 1
theDmi Avatar answered Nov 07 '22 11:11

theDmi