Max wrote:
> Hi,
>
> I'm developing a software using the great boost libraries. I need to
> create many queue for allow different object running threads to
> exchange messages between them in asyncronous mode. The message_queue
I think you are in wrong NG. IMO comp.programming.threads or a NG
related to your OS might be better. Therefore, rest of the answer is
from my own experience with threads (which is very small)
> function is the best solution since allow to post a message into
> another queue simply using the identification string. Currently, in my
> implementation, each object create a message_queue identified with the
> name of the object itself. Then create a thread remaining in wait for
> new message. This allow objects to exchange messages using only the
> name of the destination object. Very easy and very efficient.
> "Unfortunately" I read in some post that this message_queue function is
> made of interprocess communication and is not correct to use for
> interthread communication. However what is the alternative?
What I am doing doesn't involve threads, but it requires IPC. We did the
measurements, and the IPC using message queues is very fast. Sending and
receiving big messages (20k-100k bytes) is almost instantly on our
target system (2-10 us delay).
I can only advise you to measure and see if it suits your needs.
And investigate if there are better methods