Boost logo

Boost :

Subject: Re: [boost] Flow-based programming library for Boost?
From: Marcus Tomlinson (themarcustomlinson_at_[hidden])
Date: 2012-12-05 23:01:01


This library was particularly designed to allow wiring to be done at run-time but I will look into compile time-wiring. If I could just quickly do some motivation though: Building large computations out of smaller ones will not effect performance (in a run-time sense) at all due to the way I've designed the multithreading:

The multi-threading aspect of DSPatch was designed to allow the user to specify the number of threads in which he/she required the circuit to process rather than the thread count growing as the system did. So for example, an application running on a quad core system could be limited to 4 threads in order to allow each core to handle just one thread. This essentially how it works: The circuit runs through its array of components, calling each components process method in a single thread loop. As each component is done processing it hands over control to the next waiting circuit thread. Therefore, if you had 5 components in a process chain, and 5 circuit threads, at any one point in time you could have one thread per component processing in parallel. With this in place, you now also have the option to select 0 circuit threads. In this state, the circuit's Tick() and Reset() methods can be called in a while loop, for example, in the main application thread. I've added a null thread class that just implements stub methods so DSPatch can compile on platforms with no native thread support. What I've just described are circuit threads (threads that traverse the whole circuit). Another thread type is the component thread. The component thread simply ticks a single component over and over. As the circuit class inherits from component, we use it's component thread to tick the circuit automatically whilst using the main application thread for control.

I hope this clarifies my definition of "efficient".

On 06 Dec 2012, at 4:43, Dave Abrahams <dave_at_[hidden]> wrote:

>
> on Wed Dec 05 2012, Marcus Tomlinson <themarcustomlinson-AT-gmail.com> wrote:
>
>> Is there any interest out there for a library that allows you to create
>> fast, efficient flow-based programs with an easy-to-use object-oriented
>> interface? (http://en.wikipedia.org/wiki/Flow-based_programming)
>>
>> I've created an open-source library that does this, called "DSPatch" (
>> http://sourceforge.net/projects/dspatch) and would like to contribute it to
>> the Boost Libraries.
>>
>> Please let me know if this sounds like something you'd like to see in Boost.
>
> If you want such a library to be truly efficient, you should be able to
> wire together the dataflows at compile-time and not pay any overhead for
> composing large computations out of smaller ones. The accumulators
> library uses something like a dataflow model, with the "wiring" done
> completely at compile-time.
>
> --
> Dave Abrahams
> BoostPro Computing Software Development Training
> http://www.boostpro.com Clang/LLVM/EDG Compilers C++ Boost
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk