Message queue and multithreading

R

Ragid

I want to use message queue in my PC for communicating between my
applications. Some of the applications are multithread.
How does a multithread application support MSMQ?
Regards
Ragid
 
C

CY

How does a multithread application support MSMQ?
Regards
Ragid

What is problematic with a queue in a single/multithread? is not a
postbox for every person that want to send messages, just a few.
on the receiving end either use diffrerent queues for differend
receivers/threads ,as all have their own box. Or parse messages with
peek (not really recommended)

Or am I missing something?
 
G

Göran Andersson

Ragid said:
I want to use message queue in my PC for communicating between my
applications. Some of the applications are multithread.
How does a multithread application support MSMQ?
Regards
Ragid

Normally only the main (GUI) thread of an application has a message pump.
 
B

Ben Voigt [C++ MVP]

Göran Andersson said:
Normally only the main (GUI) thread of an application has a message pump.

AFAIK, MSMQ is a completely different beast from window messages.
 
R

Ragid

Thanks,
Regarding asynchronous receive, what are the proms and cones between
Callback and using events?
Regards
Ragid

Ben Voigt said:
Göran Andersson said:
Normally only the main (GUI) thread of an application has a message pump.

AFAIK, MSMQ is a completely different beast from window messages.
 
P

Peter Duniho

Thanks,
Regarding asynchronous receive, what are the proms and cones between
Callback and using events?

In what context, _specifically_?

In general, there's little practical difference between using a callback
or an event. They are both essentially the same thing, except for some
minor semantic differences. That is, with an event, you always have to
use the add/remove methods, whereas with a callback you are generally
passing a delegate to a method (but it could be assigned to a property and
even added to/removed from the current value of a delegate property in a
similar fashion to the way an event works).

For specific APIs, there could sometimes be differences in the underlying
mechanics for a class that offers both, but in all the cases I'm aware of
it's simply a matter of what design choice the author of the class decided
on. Are you looking at some class that allows either subscription to an
event or providing a callback delegate according to the preference of the
client code?

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top