Lin
2007-09-04 16:08:08 UTC
This was a post to microsoft.public.win32.programmer.wmi, but it might be
related to XInput stuff, so forwarded it here as well. (seems WMI group is
not very active)
----------------------------------------------
It seems that XInputGetState call from another thread (invoked once per
second, priority NORMAL) somehow blocks the normal WMI (related) operations.
We found out that by freezing all the suspecious threads of our application,
and then unfreeze them one by one. And the thread calling XInputGetState is
thus spotted.
Commenting out the code calling XInputGetState in our experiments makes WMI
process responsive again. However, XInputGetState has to be invoked regularly
to detect Xbox360 controller connectivity - which even is suggested by MSDN
documentation to be invoked on a framely basis (but calling it once every
second seems fullfill our needs already)
I also noticed that the sample code from the URL
"http://msdn2.microsoft.com/en-US/library/bb173051.aspx" actually utilizes
WMI services, thus I am suspecting that XInputGetState internally actually
relies on WMI doing the real work. Could that potentially interfere with our
own WMI query operations (FYI, what we are querying are Win32_NetworkAdapter
and Win32_NetworkAdapterConfiguration)
Thanks for any helpful comments!
related to XInput stuff, so forwarded it here as well. (seems WMI group is
not very active)
----------------------------------------------
It seems that XInputGetState call from another thread (invoked once per
second, priority NORMAL) somehow blocks the normal WMI (related) operations.
We found out that by freezing all the suspecious threads of our application,
and then unfreeze them one by one. And the thread calling XInputGetState is
thus spotted.
Commenting out the code calling XInputGetState in our experiments makes WMI
process responsive again. However, XInputGetState has to be invoked regularly
to detect Xbox360 controller connectivity - which even is suggested by MSDN
documentation to be invoked on a framely basis (but calling it once every
second seems fullfill our needs already)
I also noticed that the sample code from the URL
"http://msdn2.microsoft.com/en-US/library/bb173051.aspx" actually utilizes
WMI services, thus I am suspecting that XInputGetState internally actually
relies on WMI doing the real work. Could that potentially interfere with our
own WMI query operations (FYI, what we are querying are Win32_NetworkAdapter
and Win32_NetworkAdapterConfiguration)
Thanks for any helpful comments!
Are there any known issues with the WMI thread possibly being starved by
other application level threads (all in the NORMAL thread priority) in the
same process (in the NORMAL process priority group) which utilizes WMI
service in the semi-async manner? (C++, single core CPU)
The application is realtime DX9 based and graphics intensive, with several
NORMAL priority threads (including the main thread, with minimal waiting in
favor of the application's main looping), and several higher than NORMAL
priority threads for sound mixing (with appropriate blocking at regular
intervals).
We first suspected that the higher than NORMAL threads were starving the WMI
thread (with priority NORMAL), but we found out that if it starved the WMI
thread at thread priority NORMAL, it should also have starved the main
thread, however, it is not true, since the main thread and other threads are
running in their full capacity (renders well, very responsive); and the
higher than NORMAL priority threads all acting very nice to sleep at regular
intervals (that's why they don't starve the main thread)
Now we suspect that it is actually the main thread is starving the WMI
thread; OR the whole application process is actually starving the background
WMI service (in another process) and we believe that the latter might be
more probable.
We then looked at process/thread priority boost when our application is in
the foreground (since our application process is in priority NORMAL process
priority group, as well as the WMI service process, or it's not true?),
things didn't get any better even if we minimized our application.
The WMI stuff seems get responsive at least in 30 seconds interval (we are
basically posting async queries in a continuous manner when the last query
finishes with Indicate/SetStatus callback)
When our application runs in dedicated text mode (without DX9 graphics
intensive stuff), it seems WMI stuff is more responsive, but not at its
extreme; acceptable, however)
How is WMI stuff internally behave? is it behaving too nicely that if other
process (even with the same priority group) is busy one something, it yields
its processing time, and wait indefinitely?
As a side note (might be related?) - we also noticed not only the WMI
service seemed starved, even the normal IO manager seemed somehow starved
that we don't get IO completion notification when we should, when running in
intensive DX9 based system on single core machines. Putting some sleep in
the main thread seemed making the Windows IO manager responsive again (we
get completed IO notifications again)
Thanks!
other application level threads (all in the NORMAL thread priority) in the
same process (in the NORMAL process priority group) which utilizes WMI
service in the semi-async manner? (C++, single core CPU)
The application is realtime DX9 based and graphics intensive, with several
NORMAL priority threads (including the main thread, with minimal waiting in
favor of the application's main looping), and several higher than NORMAL
priority threads for sound mixing (with appropriate blocking at regular
intervals).
We first suspected that the higher than NORMAL threads were starving the WMI
thread (with priority NORMAL), but we found out that if it starved the WMI
thread at thread priority NORMAL, it should also have starved the main
thread, however, it is not true, since the main thread and other threads are
running in their full capacity (renders well, very responsive); and the
higher than NORMAL priority threads all acting very nice to sleep at regular
intervals (that's why they don't starve the main thread)
Now we suspect that it is actually the main thread is starving the WMI
thread; OR the whole application process is actually starving the background
WMI service (in another process) and we believe that the latter might be
more probable.
We then looked at process/thread priority boost when our application is in
the foreground (since our application process is in priority NORMAL process
priority group, as well as the WMI service process, or it's not true?),
things didn't get any better even if we minimized our application.
The WMI stuff seems get responsive at least in 30 seconds interval (we are
basically posting async queries in a continuous manner when the last query
finishes with Indicate/SetStatus callback)
When our application runs in dedicated text mode (without DX9 graphics
intensive stuff), it seems WMI stuff is more responsive, but not at its
extreme; acceptable, however)
How is WMI stuff internally behave? is it behaving too nicely that if other
process (even with the same priority group) is busy one something, it yields
its processing time, and wait indefinitely?
As a side note (might be related?) - we also noticed not only the WMI
service seemed starved, even the normal IO manager seemed somehow starved
that we don't get IO completion notification when we should, when running in
intensive DX9 based system on single core machines. Putting some sleep in
the main thread seemed making the Windows IO manager responsive again (we
get completed IO notifications again)
Thanks!