Click here to Skip to main content
16,005,141 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralWMI Access Pin
wakkerjack7-Jul-04 10:15
wakkerjack7-Jul-04 10:15 
GeneralRe: WMI Access Pin
Dave Kreskowiak7-Jul-04 12:41
mveDave Kreskowiak7-Jul-04 12:41 
GeneralRe: WMI Access Pin
wakkerjack9-Jul-04 23:22
wakkerjack9-Jul-04 23:22 
GeneralRe: WMI Access Pin
Dave Kreskowiak10-Jul-04 5:22
mveDave Kreskowiak10-Jul-04 5:22 
GeneralRe: WMI Access Pin
wakkerjack10-Jul-04 6:24
wakkerjack10-Jul-04 6:24 
GeneralRe: WMI Access Pin
Dave Kreskowiak10-Jul-04 14:04
mveDave Kreskowiak10-Jul-04 14:04 
GeneralRe: WMI Access Pin
wakkerjack10-Jul-04 23:17
wakkerjack10-Jul-04 23:17 
GeneralRe: WMI Access Pin
Dave Kreskowiak11-Jul-04 5:27
mveDave Kreskowiak11-Jul-04 5:27 
Now I get your problem. The issue is your swamping the target machine with requests. You have to pace your request by dropping in a Thread.Sleep() right after your Thread.Start(). What's happening is by launching 250 requests, at nearly the same time, the WMI service on the target machine can't keep up. Your pegging the target machines CPU Utilization at 100% the entire time your making these requests. In order to get it to work reliably, I had to pace the thread launches at every 150 milliseconds. This was by no means an extensive test, so for reliability, you'd probably have to increase that number to 250 milliseconds. THe only way to guarantee that it won't fail, is to launch them one at a time and wait for each request to complete before you launch the next one.

BTW: Why on earth would you want to do this? The only reason I can see is that your launching 250 requests at 250 seperate machines, not the same machine. This requirement would invalidate any testing your doing because you ar no longer stressing a single target machine.

A better way to do this would be to queue the work using the .NET Frameworks' built in ThreadPool.
public Class1()
{
    for (int i=0; i< 250; i++)
    {
        Thread a = new Thread(new ThreadStart(this.connect));
        a.Start();
        Thread.Sleep(150);
        //this.connect();
    }
}



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: WMI Access Pin
wakkerjack11-Jul-04 10:32
wakkerjack11-Jul-04 10:32 
GeneralRe: WMI Access Pin
Dave Kreskowiak11-Jul-04 11:53
mveDave Kreskowiak11-Jul-04 11:53 
GeneralRe: WMI Access Pin
Dave Kreskowiak11-Jul-04 12:03
mveDave Kreskowiak11-Jul-04 12:03 
GeneralRe: WMI Access Pin
wakkerjack12-Jul-04 3:01
wakkerjack12-Jul-04 3:01 
GeneralRe: WMI Access Pin
wakkerjack20-Jul-04 9:59
wakkerjack20-Jul-04 9:59 
GeneralGetThumbnailImage with ListView Pin
Brad Fackrell7-Jul-04 7:44
Brad Fackrell7-Jul-04 7:44 
GeneralRe: GetThumbnailImage with ListView Pin
Brad Fackrell8-Jul-04 11:37
Brad Fackrell8-Jul-04 11:37 
GeneralRe: GetThumbnailImage with ListView Pin
beowulfagate8-Jul-04 13:24
beowulfagate8-Jul-04 13:24 
GeneralRe: GetThumbnailImage with ListView Pin
Brad Fackrell9-Jul-04 9:58
Brad Fackrell9-Jul-04 9:58 
GeneralRe: GetThumbnailImage with ListView Pin
beowulfagate9-Jul-04 14:08
beowulfagate9-Jul-04 14:08 
GeneralRe: GetThumbnailImage with ListView Pin
Brad Fackrell11-Jul-04 4:04
Brad Fackrell11-Jul-04 4:04 
GeneralRe: GetThumbnailImage with ListView Pin
beowulfagate11-Jul-04 13:38
beowulfagate11-Jul-04 13:38 
GeneralRe: GetThumbnailImage with ListView Pin
Brad Fackrell12-Jul-04 4:42
Brad Fackrell12-Jul-04 4:42 
GeneralVB-6 Menus Pin
N4LXL7-Jul-04 3:06
N4LXL7-Jul-04 3:06 
GeneralRe: VB-6 Menus Pin
Dave Kreskowiak7-Jul-04 5:27
mveDave Kreskowiak7-Jul-04 5:27 
Generalsetting the track bar control Pin
Prowess6-Jul-04 23:29
Prowess6-Jul-04 23:29 
GeneralRe: setting the track bar control Pin
hpAng6-Jul-04 23:49
hpAng6-Jul-04 23:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.