views:

74

answers:

2

I'm looking for a library that can send messages from a process. It needs to be asynchronous, reliable and ordered. I don't care if it drops messages when the queue is full, but it has be able to report that. It cannot be blocking.

It should be possible to plug it into a standard app which already uses pthreads. (adding thread-safe to requirements)

I've looked at some possible solutions that could solve it... opening an erlang port and running an erlang vm for collecting messages seems to be promising, but I'm not sure if ports themselves can start sending data? It would be perfect, if I could create something like an embedded node with it's own sender.

I could of course implement something that keeps a queue in shm with a known key, or through a fifo, but that's error prone... I'd rather reuse some existing solution.

Can someone think of any (rather high-level) library that does that?

+4  A: 

Message queues are implemented by many Unices.

There are also many Message Oriented Middleware (MOM) platforms that provide distributed, reliable, transactional messaging.

Nat
+1 on MQs but prefer POSIX version: http://linux.die.net/man/7/mq_overview
Duck
POSIX is better. I've updated the answer.
Nat
A: 

There is Boost.MPI or you can use networking on the loopback interface. (Lots of libs for that.)

stribika