Can I monitor the size of a thread's message queue?

感情迁移 提交于 2019-12-04 01:04:27

问题


Our application is getting a System Call Failed RPC error from DCOM (0x80010100), we suspect that the target thread's message queue is full (although I'm not convinced this is ture). I know the queue is limited to 10,000 messages and I want to see if we're close to this number in the common cases. Is there a way to monitor the size of a thread's message queue?

The most promising option I found was GetQueueStatus but this doesn't include the number of messages in the queue only their types.


回答1:


I don't know of any way of monitoring the size of the queue (short of using a kernel debugger and groveling in the internal Win32Thread data structure at TIB+[0x40], which I hardly recommend).

For debugging purposes, to check if the queue is full when you get the error, try doing a PostThreadMessage. If it's full, the call should fail with GetLastError() == 0x718. (Not enough quota is available to process this command.)



来源:https://stackoverflow.com/questions/256734/can-i-monitor-the-size-of-a-threads-message-queue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!