Board index » cppbuilder » Message queue size

Message queue size


2006-11-21 03:48:11 AM
cppbuilder72
In my multi-threaded app, I use below code to create a message queue for a
thread:
PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
Other threads sends message to this thread:
PostThreadMessage(...);
And my question:
What is size of a message queue? Is there a chance to lost messages due
to
the queue's overflow?
 
 

Re:Message queue size

"Tumurbaatar S." < XXXX@XXXXX.COM >wrote in message
Quote
What is size of a message queue?
10,000 messages.
Quote
Is there a chance to lost messages due to the queue's overflow?
Yes, it is possible, though unlikely. Post...Message() will return FALSE if
a message cannot be posted.
Gambit
 

Re:Message queue size

Thank you!
10 thousands are too big to be overflowed. So, is there any other
reason that Post...Message() returns FALSE? Of course,
the destination window or thread is ok, i.e. handle is valid.
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Tumurbaatar S." < XXXX@XXXXX.COM >wrote in message
news:45620661$ XXXX@XXXXX.COM ...

>What is size of a message queue?

10,000 messages.

>Is there a chance to lost messages due to the queue's overflow?

Yes, it is possible, though unlikely. Post...Message() will return FALSE
if
a message cannot be posted.


Gambit


 

{smallsort}

Re:Message queue size

"Tumurbaatar S." < XXXX@XXXXX.COM >wrote in message
Quote
10 thousands are too big to be overflowed. So, is there any other
reason that Post...Message() returns FALSE? Of course,
the destination window or thread is ok, i.e. handle is valid.
Then no, there is no other way that Post...Message() should fail. If it is,
then you need to use GetLastError() to find out why it is failing.
Gambit