Message queue and multithreading

  • Thread starter Thread starter Ragid
  • Start date Start date
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
 
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?
 
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.
 
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.
 
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.
 
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
 
Back
Top