Dataflow networks have application in various forms of stream processing, for example for parallel processing of multimedia data. The description of dataflow graphs, including their firing behavior, is typically non-compositional and not amenable to separate compilation. This article considers a dataflow language with a type and effect system that captures the firing behavior of actors. This system allows definitions to abstract over actor firing rates, supporting the definition and safe composition of actor definitions where firing rates are not instantiated until a dataflow graph is launched.
IntroductionDataflow or stream processing is becoming increasingly important, with the growing prevalence of signal, video and audio processing, particularly on mobile devices. Dataflow processing is a good match with multicore and GPGPU parallel architectures that are now prevalent on desktop computers, and will shortly be available on consumer mobile devices. The data parallelism of such architectures is at least potentially a good match with the demands of stream processing applications. The synthesis of these architectures with stream processing may provide a domain-specific solution to the challenge of programming the new generations of parallel computing architectures.Our starting point is a computational model similar to that originally proposed by Kahn [11]. This provides for a network of sequential actors, each implemented in a conventional sequential language such as C or Algol. Actors are connected by communication buffers on which they can send and receive data. A key point is that actors cannot nondeterministically select among inputs on several input channels, nor can they test input channels for available inputs (so polling cannot be implemented). This restricts each actor to a completely deterministic semantics. The combination of implicit parallelism and deterministic execution makes dataflow computation a good fit with some of the current thinking of how best to successfully exploit the parallelism available in modern multicore and GPGPU architectures, in those domains where the dataflow paradigm is applicable.In the embedded systems and digital signal processing community, a very useful class of restricted Kahn networks has been identified, the so-called synchronous dataflow (SDF) [14] networks. SDF networks enable static scheduling for multi-rate applications. More recently, domain-specific languages such as Streamit [15] have been defined, based on the principles of SDF, but also providing support for compiling programmer code to run on modern parallel architectures.Sessional dataflow provides a framework for providing compositional descriptions of dataflow networks [7]. A type and effect system captures the firing behavior of actor bodies, and this information is used to ensure that the composition of actors does not deadlock. For simplicity, that simple effect system did not consider variable firing rates for actors, so for example no communication was possible within a loop (finite loops were sti...