Dataflow concepts are the heart of Reactive Programming, Flow-Based Programming (e.g. NoFlo), Unix pipes, Actors and message passing in general. Dataflow-based systems are easy to design once you understand the large number of implementation details that could drastically change how the system operates. Understanding these vectors of change is important so you don't waste your time developing the wrong system. Embedded dataflow-like languages are used in a wide range of applications. Video games, web pages, circuit simulation and music production are just a few of the domains that have been using dataflow for years. Every one of those has a specialized dataflow engine designed for the task at hand. This book will help you understand the whole dataflow universe before starting your own system. By the end of the book you will understand... - All possible design choices with dataflow-based systems - How their effects interplay - How to develop your own dataflow-based system Table of Contents Special Thanks DSP Robotics ghostream Clean Code Developer School Synthetic Spheres ANKHOR Software GmbH vvvv Code Examples Introduction Overview of the Book Reactive Programming is Dataflow Von Neumann Architecture Benefits of Dataflow History The Purpose of this Book Dataflow Explained Pipeline Dataflow Nodes Data Arcs Dataflow Graphs Executing a Graph Features of Dataflow Systems Push or Pull Data Mutable or Immutable Data Static or Dynamic Dynamic Static Functional or Stateful Nodes Synchronous or Asynchronous Activation Asynchronous Synchronous Hybrid Multiple Inputs and/or Outputs Multiple Inputs Multiple Outputs Fire Patterns Cycles and Feedback Recursion Implementation of Recursive Nodes Compound Nodes Execution of Compound Nodes Design of Compound Nodes Arc Capacity > 1 Arc Joins and/or Splits Multi-Rate Token Production and Consumption Common Dataflow Nodes Switch Node/ Choice Node Merge Node/ Correlate Node/ Join Node Distribute Node/ Splitter Node Gate Node Terminal Node Source Node Sink Node Miscellaneous Topics Granularity When is it Done? Actor Model Summary of the Actor Model Comparison to Object Oriented Programming Relation to Dataflow Dataflow Features Where is the Actor Model Used? Where is it Not Used? Flow-Based Programming Summary of Flow-Based Programming Dataflow Features Benefits of Flow-Based Programming Communicating Sequential Processes Summary of CSP Message Passing Channels Channels as a Concurrency Primitive Channel Implementations Implicit Dataflow Unix Pipes Sockets Function Manager Controlled Communication Message Passing Channels Feature Creep Asynchronous Dataflow Implementation Architecture Overview Implementation Walk-Through Main Data Types Port Address Data Token Execute Token Node Node Definition Arc Fire Pattern Token Store Node Store Arc Store Dataflow Program Implementation Components IO Unit Transmit Unit Enable Unit Execute Unit Program Execution Example Preparing a Program for Execution Multiple Dataflow Engines Synchronous Dataflow Implementation Compilation How to Build a Schedule Label Nodes/Arcs and Token Rates Create a Topology Matrix Does a Schedule Exist? Determine Initial Arc Capacities Execution Simulation Simulation Process Overview Simulation Process in Detail Step 1: Create a new activation matrix: Step 2: Create an activation vector Step 3: Create new Token and Fire Count Vectors Step 4: Stop or Repeat Analyze for Errors Search for a Schedule Test Schedule Parallel Schedules Dynamic Dataflow Implementation Introduction Overall Design Features of this Design Notation Convention General Types Nodes Pipeline Node PipelineNodeObject Methods Developer Accessible Nodes Primitive Node PrimitiveNodeObject Methods: Operation of a PimitiveNodeObject Compound Nodes CompoundNodeObject Methods NodeClass and NodeObject NodeObject Methods Limitations: Implementation Language Requirements: Appendix Glossary Bibliography Important Books and Papers General Hardware Synchronous Dataflow Communicating Sequential Processes Actor Model Programming Languages