hdolder.com srl  

Software R&D

   hdc Home    |    Content    |    Blog    |    Director    |    Contact    |    mail us   


M&P Implicit Parallelism => Dataflow

Posted on June 25, 2015 by Herman E. Dolder

M&P supports the paradigm "all asynchronous - all parallel" by means of a component called "Task Parallel Engine" (TPE) implemented in a lightweight library (~ 400 LOC) that is part of the M&P Runtime Library (MPRTL). TPE is implemented on both M&P platforms: H5J (HTML5 TypeScript) and .NET.

The Dataflow Parallel Programming Model

The Dataflow Programming Model (DPM) is a Parallel Programming Model that allows solve some "macro" level problems of parallelism, e.g. the protection of "Critical Sections".

The Dataflow Programming Model (DPM) visualizes applications as directed graphs where the nodes represent operations and the directed links represent flows of data messages. A directed link relates a source node that produces messages with a target node that consumes those messages.

In a DPM (Dataflow Programming Model there are three types of nodes:

  • Generator: only produces messages
  • Terminator: only consumes messages
  • Processor: consumes and produces messages

The DPM is a software analogy of work-flows in industrial processes in which material work-items are processed in a series of work-stations (e.g. assembly lines). Work-stations operation start when work-items arrive. Work-stations operate in parallel.

M&P DFTransactions and DFBLOCKS

In M&P DPM the "work-items" are messages that are called "DFTransactions" and the "work-stations" are Dataflow Blocks called DFBLOCKS.

DFTransactions encapsulates and transport data between DFBLOCKS.

DFBLOCKS are specialized M&P BLOCKS that provides Dataflow functionality trough a set of defined interfaces.

M&P provides a set of built-in DFBLOCKS from which Custom DFBLOCKS can easily created by inheritance and overriding.

Conceptually M&P DFBLOCKS are superset-subset of the MS TPL Dataflow Blocks [ R5 ].
Until M&P version 8 we used MS TPL Dataflow Blocks [ R5 ] in the .NET platform of M&P

The NS TPL Dataflow Blocks presented several severe limitations for M&P:

  • Blocks classes are sealed so they can't be extended by inheritance and overriding.
  • Blocks classes are not XAML-friendly (do not have parameter-less constructors) so they can't be instantiated in XAML and Dataflow networks can't be composed declaratively in XAML.
  • Blocks are not designed for databinding.
  • TPL Dataflow is highly depend on .NET and can't be ported to the M&P H5j platform.

In M&P version 9 we Introduced TPE Dataflow in both M&P platforms, unifying and DFBplifying the APIs, the logic and the exception handling to facilitate applications maintenance and enhance their adaptability.

M&P Dataflow Blocks can be easily extended by inheritance and overriding and instantiated in BXaml allowing declarative composition and databinding.



TBW The BLOCKS World 2015  hdolder.com srl