Thanks Dave
Post by David LowndesSo what was causing it to stop processing its messages? Is it busy
doing a long task, or is your other thread starving it by running at a
higher priority?
Still working on this issue. It seems not the cases you suspected. In fact,
this problem has happened for 4 years(from NT to WindowsXP). We had offically
asked Microsoft's prieme support, but they required us to set up some
monitoring tools on the problem PCs. However, all problem PCs were on
production and no extra programs were allowed to run. The only thing we could
do is to collect the program trace. Base on the program trace, we found the
UI thread occassionally stopped running while the other thread kept posting.
The period of the suspension of UI thread varied from several seconds to 2
days. the case of the 70,000 messages was lasted for 2 days.
Post by David LowndesThose are big numbers (compared to the old 16-bit limits) :)
How do you know 70,000 messages were posted and only 50,000 were
processed? Did all the PostMessage calls succeed?
Based on the trace, I found there had 70,000 messages been posted to the UI
thread and there had 50,000 messages been processed by the UI thread. Since
the program did not check the result of PostMessage, I dont know the problem
was due to PostMessage failure or the exceeding of message queue.
Post by David LowndesI assume you've already found the Platform SDK documentation on MSDN,
such as the topic titled "Using Messages and Message Queues".
I have not search the MSDN yet. I think it should be a registry setting,
which can be configurable.
Regards
lauch
Post by David LowndesPost by lauch2My application has 2 threads, one is UI thread(the main thread); another is
a thread that would post message to the UI thread to update screen. However,
I found that the UI thread would stop running occassionally and resume to
normal after some time.
So what was causing it to stop processing its messages? Is it busy
doing a long task, or is your other thread starving it by running at a
higher priority?
Post by lauch2When the UI thread stopped running, another thread
had posted some 70,000 messages to the UI thread, it looks like only the
first, say, 50,000 messages would be processed by the UI thread when it
resume to normal.
Those are big numbers (compared to the old 16-bit limits) :)
How do you know 70,000 messages were posted and only 50,000 were
processed? Did all the PostMessage calls succeed?
Post by lauch2Anyway, I just want to collect more information about the window message
queue.
An other idea?
To do what?
I assume you've already found the Platform SDK documentation on MSDN,
such as the topic titled "Using Messages and Message Queues".
Dave