Channel is a C++ template library to provide name spaces for
asynchronous, distributed message passing and event dispatching.
Message senders and receivers bind to names in name space; binding and
matching rules decide which senders will bind to which receivers; then
message passing and event dispatching could happen among bound senders
and receivers.
Channel's signature:
template <
typename idtype,
typename platform_type = boost_platform,
typename synchpolicy = mt_synch<platform_type>,
typename executor_type = abstract_executor,
typename name_space =
linear_name_space<idtype,executor_type,synchpolicy>,
typename dispatcher =
broadcast_dispatcher<name_space,platform_type>
>
class
channel;
Various name spaces (linear/hierarchical/associative) can be used for
different applications. For example, we can use integer ids as names to
send messages in linear name space, we can use path name ids (such as
"/sports/basketball") to send
messages in hierarchical name space and we can use regex patterns or
Linda tuple-space style tuples to send messages in associative name
space; User can configure name space
easily
by setting a channel template parameter.
Channel's other major components are dispatchers; which dispatch
messages/events from senders to bounded receivers. Dispatcher is also a
channel template parameter. Sample dispatchers includes :
synchronous broadcast dispatcher,
buffered asynchronous dispatchers,...
Name space and dispatchers are orthogonal; they can mix and match
together freely; just as STL algorithms can be used with any STL
containers.
By combining different name space and dispatching policies, we can
achieve various models:
- synchronous event dispatching
- associative name space based on matching/look-up rules similar to
Linda tuple space
- asynchronous messaging model similar to Microsoft CCR
(Concurrency Coordination Runtime)
Similar to distributed files systems, distributed channels can be
connected or "mounted" to allow transparent distributed message
passing. Filters and translators are used to control name space changes.
For tightly coupled single-address-space applications/modules,
Channel's "unnamed" in/out
objects : ports and signal/slots support fine grained and local message
passing model without
the hassle of setting up a name space and assigning names.
Boost Channel
Boost Channel is the latest implementation of Channel framework for
Boost. Boost provides free
peer-reviewed portable C++ source libraries. It is emphasized that
libraries work well with the C++ Standard Library. Boost libraries are
intended to be widely useful, and usable across a broad spectrum of
applications. Boost Channel is solely based on standard boost
facilities:
- Boost::shared_ptr for message/event data life-time management
- Boost.Bind, Boost.Function for callback
- Boost.Thread for synchronization
- Boost.Serialization for message marshaling/demarshaling
- Boost.Regex and Boost.Tuple for associative name-matching
- Boost.Asio and Boost.Shmem are used to build
transports among remote channels.
Detailed Info:
ACE Channel
ACE Channel is the first implementation of Channel framework on top of
ACE (Adaptive
Communication Environment) . ACE is a
powerful and portable OO/C++ framework for system programming. It
provides not only wrapper facade classes to abstract the complete OS
facilities, but also frameworks and design patterns for developing
multithreaded and distributed applications. ACE Channel uses several
key ACE facilities including Reactor,
Service Configurator, Task and Acceptor-Connector.
Theoretically Boost Channel can work on any platforms where Boost is
supported, since it is solely dependent on Boost
facilities. Currently Boost Channel is being actively developed
and tested in the
following platforms:
- Linux (Fedora, Ubuntu) with gcc
- Windows XP with Visual C++ 2005 Express
It will be tested on other platforms (Solaris, NetBSD...) when time and
resources are available.
checkout boost
cvs source code
download latest boost_channel_x_x.tar.gz
tar xvzf boost_channel_x_x.tar.gz
cd <top directory of channel>
copy subdirectory boost/channel/ to <boost
root directory>/boost/
copy subdirectory
libs/channel/ to <boost root directory>/libs/
cd to <boost root
directory>/libs/channel/exmaple/<specific samples such as
ping_pong>
bjam
yigongliu@gmail.com