Help PostMessage Delay




We have observer long delay for PostMessage calls

Here is what we are doing

OS wince4.2 Internet Appliance config with QFE to 2005Q2

A winsock application with two threads
One main thread and one receive thread.
The receive thread has lower thread priority

In the receive thread, a blocking style recvfrom call is used to
receive packets. After the recvfrom call returns, a PostMessage call
is made to post a message back to main thread.
Here we observe that PostMessage takes more than one second to return.
This is very strange.
Maybe this approach is bad but PostMessage should return rather
quickly.

On MSDN online help it says
Windows 2000/XP: There is a limit of 10,000 posted messages per message
queue. This limit should be sufficiently large. If your application
exceeds the limit, it should be redesigned to avoid consuming so many
system resources. To adjust this limit, modify the following registry
key:


We wonder if wince has a similar setting. Are we hitting that limit.
Has anyone seen similar delay issues with PostMessage calls?

Thanks for your help.

--wjm

.