C ++ library for creating an execution pipeline

I was looking for a reusable runtime conveyor library in C ++ (task scheduler library?). I could not find anything in Boost . Therefore, in the end, I discovered two candidates:

Are there any other candidates? Has anyone used them? How good are they for concurrency and multithreading? These libraries seem to be missing dependency processing. For example, it doesn't seem clear to me how to write something like:

$ cat /dev/urandom | tr P Q | head -3

In this very simple case, the conveyor goes from bottom to top, and the first catstops execution when the process headstops pulling.

However, I don't see how I can benefit from io multithreading and concurrency in the case, for example:

$ cat /raid1/file1 /raid2/file2 | tr P Q > /tmp/file3

: tr 7 , 8 .

+5
3

, . , 1 1 .

Boost , , , Boost. : http://dancinghacker.com/code/dataflow/dataflow/introduction/dataflow.html

, Unix-. , ( ) /.

. , ( pipe: 1-consumer/1-), . Piping - - , . / . ( , .)

+3

RaftLib, , "". , , Bash, . , :

#include <raft>
#include <raftio>
#include <cstdlib>
#include <string>

class hi : public raft::kernel
{
public:
    hi() : raft::kernel()
    {
       output.addPort< std::string >( "0" ); 
    }

    virtual raft::kstatus run()
    {
        output[ "0" ].push( std::string( "Hello World\n" ) );
        return( raft::stop ); 
    }
};


int
main( int argc, char **argv )
{
    /** instantiate print kernel **/
    raft::print< std::string > p;
    /** instantiate hello world kernel **/
    hi hello;
    /** make a map object **/
    raft::map m;
    /** add kernels to map, both hello and p are executed concurrently **/
    m += hello >> p;
    /** execute the map **/
    m.exe();
    return( EXIT_SUCCESS );
}
+2

I would give Threading Building Blocks http://threadingbuildingblocks.org/ a try. This is an open source and cross-platform. The Wikipedia article is pretty good: http://en.wikipedia.org/wiki/Intel_Threading_Building_Blocks

+1
source

All Articles