A method for running diagnostic utilities so as to prevent system disruptions.
During initialization of a diagnostic utility, a resource monitoring thread is
spawned as a background process to monitor system resource conditions, such as
CPU and memory availability and loads. In one embodiment, the resource conditions
are continuously monitored by querying performance data written to the system's
registry on a periodic basis. In response to user requests to perform diagnostics,
the resource monitoring thread (or files written thereby) is/are queried to determined
the current resource conditions. If enough resources are available to run the utility's
diagnostic routine(s), they are allowed to run. If it is determined that not enough
resources are available, the running of the diagnostics is delayed until it is
determined that enough resources are available. Alternately, a subset of the diagnostics
may be run based on the current resource conditions determined by the resource
monitoring thread.