Implications of the USERPostMessageLimit Change

One of our legacy applications relies heavily on PostThreadMessage () for cross-threading, so we have increased USERPostMessageLimit in the registry (path) beyond the usual 10.000.

However, the MSDN documentation states that "this limit should be large enough. If your application exceeds the limit, it should be redesigned to avoid consuming so many system resources." [ 1 ]

Can someone enlighten me on how exactly it consumes too many system resources? What are system resources? Can I somehow control the use of applications by system resources? Any information would be very helpful in deciding whether it is worth the time and effort to redesign this application.

+4
source share
1 answer

The resources to which it refers include those used by threads to receive / process messages. You can control the thread pool size and other resources using the task manager (see View-> Select Columns). This can help you determine a specific resource, if the consumer is blocked by a resource, look for the amount of resources that reaches a maximum even at a time when your flows are increasing.

Nonetheless; if you need to increase USERPostMessageLimit, then the message producer simply overloads the message user; by increasing this limit, you exacerbate your problem without correcting it. Decreasing USERPostMessageLimit returns to default, and if your message producer cannot post a message, try to sleep before retrying so that the consumption stream can clear some messages.

+1
source

Source: https://habr.com/ru/post/1276806/


All Articles