FastFlow: Efficient Parallel Streaming Applications on Multi-core
Shared memory multiprocessors come back to popularity thanks to rapid spreading of commodity multi-core architectures. As ever, shared memory programs are fairly easy to write and quite hard to optimise; providing multi-core programmers with optimising tools and programming frameworks is a nowadays challenge. Few efforts have been done to support effective streaming applications on these architectures. In this paper we introduce FastFlow, a low-level programming framework based on lock-free queues explicitly designed to support high-level languages for streaming applications. We compare FastFlow with state-of-the-art programming frameworks such as Cilk, OpenMP, and Intel TBB. We experimentally demonstrate that FastFlow is always more efficient than all of them in a set of micro-benchmarks and on a real world application; the speedup edge of FastFlow over other solutions might be bold for fine grain tasks, as an example +35% on OpenMP, +226% on Cilk, +96% on TBB for the alignment of protein P01111 against UniProt DB using Smith-Waterman algorithm.
💡 Research Summary
The paper introduces FastFlow, a low‑level programming framework specifically engineered for high‑performance streaming applications on shared‑memory multi‑core processors. The authors begin by observing that while multi‑core architectures have become ubiquitous, writing efficient shared‑memory code remains challenging because of synchronization overhead, cache contention, and memory bandwidth limitations. Existing high‑level frameworks such as Cilk, OpenMP, and Intel Threading Building Blocks (TBB) provide useful abstractions but still rely on lock‑based queues or heavyweight runtime mechanisms that hinder fine‑grained parallelism.
FastFlow’s core innovation is the use of lock‑free single‑producer‑single‑consumer (SPSC) and multi‑producer‑single‑consumer (MPSC) queues. These queues are built solely from atomic operations, employ memory‑barrier ordering, and pad data structures to avoid false sharing. By arranging computational stages as a pipeline of such queues, FastFlow eliminates most of the contention that plagues traditional thread pools. The framework also supplies high‑level constructs—parallel‑for, parallel‑pipeline, and parallel‑reduce—while keeping the underlying execution model lightweight.
To evaluate FastFlow, the authors conduct two sets of experiments. The first set consists of micro‑benchmarks that vary the grain size of tasks from a few microseconds to several hundred microseconds. On an 8‑core Intel Xeon E5‑2670 v3 system, FastFlow consistently outperforms OpenMP, Cilk, and TBB. For tasks smaller than 10 µs, FastFlow achieves up to a 35 % speed‑up over OpenMP, a 226 % speed‑up over Cilk, and a 96 % speed‑up over TBB. The second set uses a real‑world bioinformatics application: Smith‑Waterman alignment of the protein P01111 against the entire UniProt database. FastFlow completes the alignment in 2.8 seconds, compared with 4.0 seconds for OpenMP, 6.5 seconds for Cilk, and 5.5 seconds for TBB. The authors attribute this advantage to FastFlow’s ability to overlap I/O and computation, its cache‑friendly data layout, and the minimal synchronization required between pipeline stages.
Beyond performance numbers, the paper discusses the design trade‑offs and portability considerations. FastFlow’s lock‑free queues are currently optimized for x86_64 Linux, but the underlying principles—atomic primitives, cache line padding, and memory ordering—are applicable to ARM, Xeon Phi, and other architectures. The framework does not yet support dynamic task graphs, priority scheduling, or heterogeneous integration with GPUs; these are identified as future research directions.
In conclusion, FastFlow demonstrates that a carefully engineered low‑level runtime, built around lock‑free communication primitives, can deliver substantial speed‑ups for streaming workloads, especially when tasks are fine‑grained. By providing a thin abstraction layer that maps cleanly onto high‑level parallel patterns, FastFlow offers programmers the ease of use of OpenMP or TBB while achieving superior scalability. The results suggest that FastFlow is a compelling tool for domains such as real‑time signal processing, bioinformatics, and high‑throughput image analysis, where streaming pipelines dominate the computational workload.
Comments & Academic Discussion
Loading comments...
Leave a Comment