dima
dima

Reputation: 27

Message queue, c++ multi thread

I looking for cross platform multithread message queue implementation on c++ (not slot/signal) . Better if it based on subject-observer pattern.

Upvotes: 2

Views: 5635

Answers (4)

Ilya Storozhilov
Ilya Storozhilov

Reputation: 11

Take a look to the "ISL" open source project (stands for an "Internet Server Library", C++), which SVN-repository is located on http://svn.storozhilov.com/isl/ - isl::AbstractMessageBroker class is a good candidate for a basement of your job. This is quite simple but extensible skeleton for any message broker subsystem (DBus, JMS, AMQP, etc.). Each client is served by 2 threads from the pre-started thread's pool: one is for receiving message from the transport and processing message and another is for sending message to transport. So, actually in order to implement your messaging system you have to override at least following three virtual methods:

    isl::AbstractMessageBroker::receiveMessage(...);
    isl::AbstractMessageBroker::processMessage(...);
    isl::AbstractMessageBroker::sendMessage(...);

Example of use is in trunk/examples/EchoMessageBroker directory. Responses client with echoed message, terminates connection on "bye\r\n" message, terminates itself on SIGINT.

Upvotes: 1

sbi
sbi

Reputation: 224159

Have a look at Intel's Open Source lib Threading Building Blocks. They are cross-platform and last time I looked they had lock-free containers.

Upvotes: 0

DumbCoder
DumbCoder

Reputation: 5766

You can try out Apache ActiveMQ. http://activemq.apache.org. Quite robust.We use it for a FIX messaging platform, quite responsive and easy to configure also.

Upvotes: 0

camh
camh

Reputation: 42538

ZeroMQ looks like it may be what you are looking for.

It is well documented with lots of examples, such as this one: http://www.zeromq.org/blog:multithreaded-server , which may be what you are trying to implement.

Upvotes: 3

Related Questions