FastFlow  SVN-r182-Aug-14-2014
A high-level, lock-less, parallel programming (shared-memory) and distributed programming (distributed-memory) framework for multi-cores and many-cores systems
 All Classes Namespaces Files Functions Variables Typedefs Groups Pages
Classes | Namespaces
buffer.hpp File Reference

This file contains the definition of the bounded SPSC channel buffer used in FastFlow. More...

#include <cstdlib>
#include <cstring>
#include <ff/sysdep.h>
#include <ff/config.hpp>
+ Include dependency graph for buffer.hpp:
+ This graph shows which files directly or indirectly include this file:

Classes

class  ff::SWSR_Ptr_Buffer
 SPSC bound channel (Single-Writer/Single-Reader) More...
 
class  ff::Lamport_Buffer
 Implementation of the well-known Lamport's wait-free circular buffer. Not currently used. More...
 

Namespaces

 ff
 The principal namespace for the FastFlow library.
 

Detailed Description

This file contains the definition of the bounded SPSC channel buffer used in FastFlow.

Single-Writer Single-Reader circular buffer. No lock is needed around pop and push methods. Wait-free and fence-free (in the TSO model).

A single NULL value is used to indicate buffer full and buffer empty conditions.

More details about the SWSR_Ptr_Buffer implementation can be found in:

Massimo Torquati, "Single-Producer/Single-Consumer Queue on Shared Cache Multi-Core Systems", TR-10-20, Computer Science Department, University of Pisa Italy,2010 ( http://compass2.di.unipi.it/TR/Files/TR-10-20.pdf.gz )

M. Aldinucci, M. Danelutto, P. Kilpatrick, M. Meneghin, and M. Torquati, "An Efficient Unbounded Lock-Free Queue for Multi-core Systems," in Proc. of 18th Intl. Euro-Par 2012 Parallel Processing, Rhodes Island, Greece, 2012, pp. 662-673. doi:10.1007/978-3-642-32820-6_65