Hello,

I'm writing a monitoring software that shows how many messages are in the monitored message queues. The message queue runs on a server, the monitoring software on the client. The problem is: If there are many messages (>=100) in a particular queue, my program takes very long count them. Since I couldn't find a better way, I'm "downloading" all messages:
int result = myQueue.GetAllMessages().Length;
It seems that every message is downloaded in a separate thread and the thread pool can't handle that much. Is there a better way to count the messages?